File tree Expand file tree Collapse file tree
spawn-docker-jdk/src/test/java/build/spawn/docker/jdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868
6969 <!-- Module Dependency Versions -->
7070 <assertj .version>3.27.7</assertj .version>
71- <base .version>0.22.1 </base .version>
71+ <base .version>0.23.0 </base .version>
7272 <byte-buddy .version>1.18.4</byte-buddy .version>
73- <codemodel .version>0.20.1 </codemodel .version>
73+ <codemodel .version>0.21.0 </codemodel .version>
7474 <jackson-core .version>2.21.2</jackson-core .version>
7575 <junit .version>6.0.3</junit .version>
7676 <jakarta-inject .version>2.0.1</jakarta-inject .version>
Original file line number Diff line number Diff line change @@ -636,10 +636,10 @@ void shouldCopyAFileToAContainer()
636636
637637 try (var session = createSession ()) {
638638 final var image = session .images ()
639- .get (RABBITMQ_IMAGE )
639+ .get (ALPINE_IMAGE )
640640 .orElseThrow (() -> new AssertionError ("Failed to get the required image" ));
641641
642- try (var container = image .start ()) {
642+ try (var container = image .start (Command . of ( "sleep" , "60" ) )) {
643643
644644 Eventually .assertThat (container .onStart ())
645645 .isCompleted ();
@@ -650,13 +650,19 @@ void shouldCopyAFileToAContainer()
650650 assertThat (container .id ())
651651 .isNotNull ();
652652
653- // create a /tmp/test folder in the container
654- Eventually .assertThat (container
655- .createExecutable ("mkdir" , "/tmp/test" )
656- .execute ()
657- .onExit ())
653+ // create a /tmp/test folder in the container; withTerminal(true) ensures Detach:false so
654+ // onExit() tracks actual process completion rather than just exec launch
655+ final var mkdirExecution = container
656+ .createExecutable ("mkdir" , "/tmp/test" )
657+ .withTerminal (true )
658+ .execute ();
659+
660+ Eventually .assertThat (mkdirExecution .onExit ())
658661 .isCompleted ();
659662
663+ assertThat (mkdirExecution .exitValue ().getAsInt ())
664+ .isEqualTo (0 );
665+
660666 // establish a temporary folder and a temporary file in the folder, tar the folder and send it to the
661667
662668 // Create temp dir and a file inside it
You can’t perform that action at this time.
0 commit comments