Skip to content

Add deterministic CAS retry tests for ExhaustedDataLoaderDispatchStrategy#4329

Merged
andimarek merged 2 commits intomasterfrom
fix/deterministic-dispatch-strategy-coverage
Mar 10, 2026
Merged

Add deterministic CAS retry tests for ExhaustedDataLoaderDispatchStrategy#4329
andimarek merged 2 commits intomasterfrom
fix/deterministic-dispatch-strategy-coverage

Conversation

@andimarek
Copy link
Copy Markdown
Member

Summary

  • The per-class coverage gate was flaking on ExhaustedDataLoaderDispatchStrategy.dispatchImpl because its CAS retry branches only execute under real thread contention, making coverage non-deterministic (see PR Change Dependabot update schedule from weekly to monthly #4326 for an example)
  • Adds a ContendedCallStack test subclass that selectively injects CAS failures targeting specific state transitions, deterministically exercising both retry paths without relying on thread scheduling
  • Makes CallStack inner class package-private and adds a @VisibleForTesting constructor to support test injection — no behavioral changes to production code

Test plan

  • All 10 ExhaustedDataLoaderDispatchStrategyTest tests pass
  • JaCoCo confirms 100% line, branch, instruction, and method coverage on dispatchImpl and ExhaustedDataLoaderDispatchStrategy overall
  • CI coverage gate should no longer flake on this class

🤖 Generated with Claude Code

andi and others added 2 commits March 11, 2026 09:14
…tegy

The coverage gate was flaking on dispatchImpl's CAS retry branches because
they only execute under real thread contention, making coverage
non-deterministic. This adds targeted tests that inject simulated CAS
failures to deterministically exercise both retry paths (dispatch-setup
and early-exit) without relying on thread scheduling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 5704 (+2 🟢) 5648 (+2 🟢) 0 (±0) 0 (±0) 56 (±0)
Java 17 5704 (+2 🟢) 5647 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 21 5704 (+2 🟢) 5647 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
Java 25 5704 (+2 🟢) 5647 (+2 🟢) 0 (±0) 0 (±0) 57 (±0)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 22848 (+8 🟢) 22621 (+8 🟢) 0 (±0) 0 (±0) 227 (±0)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 28739 3120 90.2% ±0.0%
Branches 8351 1509 84.7% ±0.0%
Methods 7686 1222 86.3% ±0.0%

Changed Class Coverage (1 class)

Class Line Branch Method
g.e.i.d.ExhaustedDataLoaderDispatchStrategy +1.2% 🟢 +7.7% 🟢 ±0.0%

Full HTML report: build artifact jacoco-html-report

Updated: 2026-03-10 23:28:23 UTC

@andimarek andimarek merged commit a3ff5aa into master Mar 10, 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.

1 participant