Commit bbb572d
authored
[EBPF-1034] stabilize TestDeviceCacheRefresh_Concurrent initialization (#49936)
### What does this PR do?
Pre-initializes the device cache before starting the concurrent reader/updater goroutines in `TestDeviceCacheRefresh_Concurrent`.
### Motivation
The test can observe an inconsistent mocked device snapshot during lazy initialization (`.Count()` can trigger `Refresh()`) and intermittently fail with `count is 5`.
### Describe how you validated your changes
Ran the targeted unit test with:
- `dda inv test --targets=./pkg/gpu/safenvml --extra-args='-run TestDeviceCacheRefresh_Concurrent -count=1' -v`
We will monitor the test in CI to see if it's triggered again
### Additional Notes
Co-authored-by: guillermo.julian <guillermo.julian@datadoghq.com>1 parent bcafe99 commit bbb572d
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
| |||
0 commit comments