File tree 1 file changed +6
-6
lines changed 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -272,17 +272,17 @@ async fn async_copy_files_to_container() -> anyhow::Result<()> {
272
272
async fn async_container_exit_code ( ) -> anyhow:: Result < ( ) > {
273
273
let _ = pretty_env_logger:: try_init ( ) ;
274
274
275
- // Container that should run for 1 second and exit with a specific doe
276
- let container = GenericImage :: new ( "alpine " , "latest" )
277
- . with_cmd ( vec ! [ "/bin/sh" , "-c" , "sleep 1 && exit 4" ] )
275
+ // Container that should run until manually quit
276
+ let container = GenericImage :: new ( "simple_web_server " , "latest" )
277
+ . with_wait_for ( WaitFor :: message_on_stdout ( "server is ready" ) )
278
278
. start ( )
279
279
. await ?;
280
280
281
281
assert_eq ! ( container. exit_code( ) . await ?, None ) ;
282
282
283
- // After waiting for two seconds it shouldn't be running anymore
284
- tokio :: time :: sleep ( Duration :: from_secs ( 2 ) ) . await ;
285
- assert_eq ! ( container. exit_code( ) . await ?, Some ( 4 ) ) ;
283
+ container . stop ( ) . await ? ;
284
+
285
+ assert_eq ! ( container. exit_code( ) . await ?, Some ( 0 ) ) ;
286
286
287
287
Ok ( ( ) )
288
288
}
You can’t perform that action at this time.
0 commit comments