Commit 5af463e
committed
Fix flaky GC-based tests in AsyncLazyTests
ValueFactoryReleasedAfterExecution and AsyncPumpReleasedAfterExecution were intermittently failing in CI because GC.Collect() alone does not guarantee collection of objects tied to async state machines. Replace the non-deterministic collection loop with a single Task.Yield() to release async state machine references, followed by forced blocking full GC with GC.WaitForPendingFinalizers() to ensure deterministic cleanup.1 parent aa2d608 commit 5af463e
1 file changed
Lines changed: 6 additions & 4 deletions
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
159 | | - | |
| 159 | + | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | | - | |
173 | | - | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
0 commit comments