Commit dd9aa65
committed
test(collector): stabilize TestMemStatsEquivalence against HeapReleased drift
The test read runtime.ReadMemStats and runtime/metrics separately and compared them within 5%, with the code itself noting it hoped no GC ran in between. HeapReleased is driven by the background scavenger and drifted between the two reads, failing intermittently (seen on Linux arm64). Force a full scavenge with debug.FreeOSMemory and disable GC for the measurement window so both reads observe the same runtime state.
Signed-off-by: Kemal Akkoyun <kemal.akkoyun@datadoghq.com>1 parent 6cdc504 commit dd9aa65
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | | - | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
275 | 281 | | |
276 | | - | |
| 282 | + | |
277 | 283 | | |
278 | | - | |
279 | 284 | | |
280 | 285 | | |
281 | 286 | | |
| |||
0 commit comments