Skip to content

Comments

Fix flaky GC-based tests in AsyncLazyTests#1544

Merged
AArnott merged 1 commit intomainfrom
dev/andarno/testStabilization
Feb 23, 2026
Merged

Fix flaky GC-based tests in AsyncLazyTests#1544
AArnott merged 1 commit intomainfrom
dev/andarno/testStabilization

Conversation

@AArnott
Copy link
Member

@AArnott AArnott commented Feb 21, 2026

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.

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.
@AArnott AArnott enabled auto-merge February 21, 2026 01:48
@AArnott AArnott merged commit 7418f36 into main Feb 23, 2026
9 checks passed
@AArnott AArnott deleted the dev/andarno/testStabilization branch February 23, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants