Skip to content

Stabilize AsyncLazy value factory collection test - #1656

Open
Andrew Arnott (AArnott) wants to merge 2 commits into
mainfrom
aarnott-stabilize-pipeline-test
Open

Stabilize AsyncLazy value factory collection test#1656
Andrew Arnott (AArnott) wants to merge 2 commits into
mainfrom
aarnott-stabilize-pipeline-test

Conversation

@AArnott

Copy link
Copy Markdown
Member

ValueFactoryReleasedAfterExecution intermittently fails on Linux because its async helper can retain the tested closure through compiler-generated state, producing a false-positive leak result.

Replace the closure and async helper with a dedicated factory object behind a non-async, non-inlined boundary. Keep the AsyncLazy rooted through the assertion so the test specifically verifies that a completed lazy releases its value factory.

Remove the async helper state machine from the GC-sensitive test and keep the AsyncLazy rooted while verifying that its completed value factory is released.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 48b3b634-f1dc-4956-9b85-9ecd24ede8ac
Copilot AI lite review requested due to automatic review settings August 24, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the AsyncLazy value-factory release test by avoiding compiler-generated closure retention.

Changes:

  • Uses a dedicated factory object.
  • Adds a synchronous, non-inlined helper.
  • Keeps AsyncLazy rooted during GC assertions.

Review noted a minor XML documentation nit for the new internal helper.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/Microsoft.VisualStudio.Threading.Tests/AsyncLazyTests.cs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 48b3b634-f1dc-4956-9b85-9ecd24ede8ac
Copilot AI review requested due to automatic review settings August 24, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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