You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to build something that depends on github.com/docker/compose/v2, then ran into this issue, because all of our tests checks for goroutine leaks at the end of running.
$ go test
--- FAIL: TestLeak (0.45s)
main_test.go:12: found unexpected goroutines:
[Goroutine 19 in state chan send, with github.com/docker/compose/v2/cmd/formatter.init.0.func1 on top of the stack:
goroutine 19 [chan send]:
github.com/docker/compose/v2/cmd/formatter.init.0.func1()
/home/wxh/go/pkg/mod/github.com/docker/compose/v2@v2.14.2/cmd/formatter/colors.go:120 +0x1de
created by github.com/docker/compose/v2/cmd/formatter.init.0
/home/wxh/go/pkg/mod/github.com/docker/compose/v2@v2.14.2/cmd/formatter/colors.go:104 +0x8b
]
FAIL
exit status 1
FAIL tt 0.451s
This is because there is a non-terminating goroutine in the init():
Uh oh!
There was an error while loading. Please reload this page.
Description
Trying to build something that depends on
github.com/docker/compose/v2
, then ran into this issue, because all of our tests checks for goroutine leaks at the end of running.Steps To Reproduce
Run following test
Output:
This is because there is a non-terminating goroutine in the
init()
:Workaround
Not a best practice to bypass questionable func, but...
Compose Version
Docker Environment
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: