Skip to content

Commit

Permalink
fix Dockerlog helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoRoessner committed Aug 14, 2023
1 parent 7a79427 commit b5ed112
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/tests/docker/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ func getFreePort() (int, error) {

func Dockerlog(ctx context.Context, container testcontainers.Container, name string) error {
container.FollowOutput(&LogWriter{logger: log.New(os.Stdout, "["+name+"] ", log.LstdFlags)})
err := container.StartLogProducer(context.Background())
err := container.StartLogProducer(ctx)
if err != nil {
return err
}
go func() {
<-ctx.Done()
log.Println("stop container log for", name, container.StopLogProducer())
}()
return nil
}

Expand Down

0 comments on commit b5ed112

Please sign in to comment.