Commit ece19c8
ginkgo: fix data race
Write at 0x00c000368528 by goroutine 25:
os/exec.(*Cmd).Wait()
os/exec/exec.go:926 +0x1a4
github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func2()
github.com/onsi/ginkgo/[email protected]/ginkgo/internal/run.go:231 +0x37
Previous read at 0x00c000368528 by goroutine 96714:
github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func1()
github.com/onsi/ginkgo/[email protected]/ginkgo/internal/run.go:228 +0x3b
github.com/onsi/ginkgo/v2/internal/parallel_support.(*ServerHandler).procIsAlive()
github.com/onsi/ginkgo/[email protected]/internal/parallel_support/server_handler.go:133 +0x121
The problem is that cmd.ProcessState is not thread-safe. The solution is an
atomic bool which gets checked instead and which is written once when the
goroutine waiting for the command has determined that the command has exited.1 parent 9a84c21 commit ece19c8
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| 228 | + | |
227 | 229 | | |
228 | | - | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
0 commit comments