Skip to content

Commit 838d914

Browse files
committed
temporarily disable concurrent test execution when collecting coverage report
1 parent 1aa37c5 commit 838d914

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

internal/test/test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ func testCode(
273273
}
274274

275275
// Limit concurrency to flags.Jobs, defaulting to number of CPU cores.
276+
// When coverage is enabled, force sequential execution because the
277+
// coverage report is shared across all test file goroutines.
276278
jobs := flags.Jobs
277-
if jobs <= 0 {
279+
if flags.Cover {
280+
jobs = 1
281+
} else if jobs <= 0 {
278282
jobs = goRuntime.NumCPU()
279283
}
280284
sem := make(chan struct{}, jobs)

0 commit comments

Comments
 (0)