Skip to content

Stabilize flaky NestedDataLoader test#10003

Merged
glen-84 merged 2 commits into
mainfrom
gai/stabilize-nested-dataloader-test
Jun 29, 2026
Merged

Stabilize flaky NestedDataLoader test#10003
glen-84 merged 2 commits into
mainfrom
gai/stabilize-nested-dataloader-test

Conversation

@glen-84

@glen-84 glen-84 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • NestedDataLoader wrapped its work in a hard CancellationTokenSource(2000), so the 2-second budget had to cover the schema build, execution, and snapshot match. Under CI contention that work crossed 2s, the request was canceled, and the test failed intermittently with TaskCanceledException.
  • Replaced the fixed deadline with TestContext.Current.CancellationToken, matching the sibling tests in the same file, so the test cancels only on the real test-host token.

Test plan

  • Reproduced the original TaskCanceledException by running the full assembly under CPU contention.
  • After the change, ran the test 12× under 2× CPU saturation — all pass.

Copilot AI review requested due to automatic review settings June 29, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 flaky NestedDataLoader integration test by removing a hardcoded 2-second CancellationTokenSource timeout and instead using the test host’s cancellation token, aligning the test’s cancellation behavior with other tests in the same file.

Changes:

  • Removed CancellationTokenSource(2000) from NestedDataLoader.
  • Passed TestContext.Current.CancellationToken into ExecuteRequestAsync and MatchMarkdownAsync to avoid premature cancellations under CI load.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glen-84 glen-84 merged commit 05de140 into main Jun 29, 2026
147 checks passed
@glen-84 glen-84 deleted the gai/stabilize-nested-dataloader-test branch June 29, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants