Is it a bug or exepected behaviour?
If a test fails, I would expect it to terminate with an error (exit code 1 in this case). If I run your reproducer locally (not in Docker) with the modified TestHelloer, it works fine(*) and gives me an exit code of 0: % go test -v ./... -coverprofile=coverage.out -coverpkg=./internal/... -covermode count ? example.com/m [no test files] === RUN TestHelloer --- PASS: TestHelloer (0.00s) PASS coverage: 100.0% of statements in ./internal/... ok example.com/m/internal 0.135s coverage: 100.0% of statements in ./internal/... % echo $? 0 Therefore, if your problem only occurs when using Docker, then you should provide a docker-based reproducer (including the Dockerfile) (*) However, I had to change the go.mod file to say version 1.21. If it says 1.22, I get an error. Under Linux (go1.21.7): $ go test -v ./... -coverprofile=coverage.out -coverpkg=./internal/... -covermode count go: downloading go1.22 (linux/amd64) go: download go1.22 for linux/amd64: toolchain not available Under macOS (go1.21.6): % go test -v ./... -coverprofile=coverage.out -coverpkg=./internal/... -covermode count go: downloading go1.22 (darwin/arm64) go: download go1.22 for darwin/arm64: toolchain not available I don't *think* this is the same problem as you're seeing, since you say that the coverage file is created, and presumably you would have noticed the "toolchain not available" error message. In any case, you're using a base image with go 1.22.0. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9c635e17-c1a4-46d0-92a1-d553e1b503f4n%40googlegroups.com.