Add unit tests for ExhaustedDataLoaderDispatchStrategy by andimarek · Pull Request #4306 · graphql-java/graphql-java · GitHub
Skip to content

Add unit tests for ExhaustedDataLoaderDispatchStrategy#4306

Merged
andimarek merged 1 commit into
masterfrom
claude/analyze-coverage-drop-4GSSB
Mar 8, 2026
Merged

Add unit tests for ExhaustedDataLoaderDispatchStrategy#4306
andimarek merged 1 commit into
masterfrom
claude/analyze-coverage-drop-4GSSB

Conversation

@andimarek

Copy link
Copy Markdown
Member

Summary

  • Adds 8 targeted, deterministic unit tests for ExhaustedDataLoaderDispatchStrategy to recover branch and line coverage lost by PR Fix flaky DataLoaderPerformanceTest with deterministic synchronization #4299's switch from race-condition-dependent timing to deterministic latch-based synchronization
  • Tests directly exercise the concurrent state machine's code paths: dispatch triggers from both finishedFetching and newDataLoaderInvocation, the early-return when dataLoaderToDispatch is already set, multi-round dispatch with chained loading, serial strategy reset, subscription/deferred alternate call stacks, and startComplete/stopComplete coordination
  • All tests are fully deterministic with no timing dependencies

Test plan

  • All 8 new tests pass on Java 21
  • Verify CI passes across all Java versions
  • Confirm coverage report shows recovery of the -1.2% line / -7.7% branch drop on ExhaustedDataLoaderDispatchStrategy

https://claude.ai/code/session_01WwTVwjXS1wakJQmZYsXLvY

Add 8 deterministic tests that directly exercise the concurrent state
machine in ExhaustedDataLoaderDispatchStrategy, recovering branch and
line coverage lost when PR #4299 replaced race-condition-dependent
timing with deterministic latch-based synchronization.

Tests cover:
- Basic dispatch cycle (finishedFetching triggers dispatch)
- Early return in newDataLoaderInvocation when flag already set
- Dispatch from newDataLoaderInvocation when objectRunningCount is 0
- Multiple dispatch rounds with chained data loader invocations
- executionSerialStrategy state reset
- Subscription alternative call context with separate call stack
- startComplete/stopComplete dispatch coordination
- Deferred call context lazy call stack creation via computeIfAbsent

https://claude.ai/code/session_01WwTVwjXS1wakJQmZYsXLvY
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

@andimarek andimarek merged commit 5e00d10 into master Mar 8, 2026
11 checks passed
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