Commit 9f57b57
fix(gpu): stop the events gatherer before reinstalling the NVML mock
TestMetricNamesWithoutEBPFProbes calls collectMetricNames twice, and each
call installs a fresh global NVML mock via setupMockDevices. The events
gatherer was stopped from a t.Cleanup, which does not run until the whole
test ends, so the first call's asyncFetchWorker was still reading the
global through EventSetWait while the second call wrote it. The race
detector flagged it in CI (both the go test and bazel jobs run -race);
it did not reproduce locally because I ran without -race.
Stop the gatherer with a defer inside the helper instead. Stop() joins
the worker via wg.Wait(), so the worker is gone before the next setup.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a0132ce commit 9f57b57
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
382 | 387 | | |
383 | 388 | | |
384 | | - | |
| 389 | + | |
385 | 390 | | |
386 | 391 | | |
387 | 392 | | |
| |||
0 commit comments