@@ -278,7 +278,7 @@ func dockerLogs(ctx context.Context, d *dockerutil.Container) string {
278278 if err != nil {
279279 return fmt .Sprintf ("Failed to get docker logs: %v" , err )
280280 }
281- return logs
281+ return fmt . Sprintf ( " \n %s" , logs )
282282}
283283
284284func TestRuby (t * testing.T ) {
@@ -745,14 +745,9 @@ func testDockerComposeBuild(ctx context.Context, t *testing.T, d *dockerutil.Con
745745 t .Fatalf ("docker compose build failed: %v" , err )
746746 }
747747 defer removeDockerImage (ctx , imageName , d )
748- // Instead of waiting for a "Built" string, poll for the image existence.
749- // This is more resilient to UI changes in Docker Compose.
750- err = testutil .Poll (func () error {
751- return checkDockerImage (ctx , imageName , d )
752- }, defaultWait )
753-
754- if err != nil {
755- t .Fatalf ("image %s was not created after build: %v, docker logs: %v" , imageName , err , dockerLogs (ctx , d ))
748+ d .WaitForOutput (ctx , fmt .Sprintf ("%s Built" , imageName ), defaultWait )
749+ if err := checkDockerImage (ctx , imageName , d ); err != nil {
750+ t .Fatalf ("failed to find docker image: %v" , err )
756751 }
757752}
758753
@@ -792,11 +787,6 @@ func testDockerComposeRun(ctx context.Context, t *testing.T, d *dockerutil.Conta
792787 if err != nil {
793788 t .Fatalf ("docker compose run failed: %v" , err )
794789 }
795- waitCtx , cancel := context .WithTimeout (ctx , defaultWait )
796- defer cancel ()
797- if status , err := execProc .WaitExitStatus (waitCtx ); err != nil || status != 0 {
798- t .Fatalf ("docker compose run exited with error: %v, status: %d, docker logs: %v" , err , status , dockerLogs (ctx , d ))
799- }
800790 output , err := execProc .Logs ()
801791 if err != nil {
802792 t .Fatalf ("docker logs failed: %v" , err )
0 commit comments