Skip to content

[fix][test] Fix flaky ManagedCursorTest.testSkipEntries#25339

Merged
lhotari merged 1 commit intoapache:masterfrom
merlimat:fix/flaky-testSkipEntries
Mar 19, 2026
Merged

[fix][test] Fix flaky ManagedCursorTest.testSkipEntries#25339
lhotari merged 1 commit intoapache:masterfrom
merlimat:fix/flaky-testSkipEntries

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

@merlimat merlimat commented Mar 17, 2026

Flaky test failure

java.lang.AssertionError: expected [7:1] but found [8:-1]
	at org.testng.Assert.fail(Assert.java:110)
	at org.testng.Assert.failNotEquals(Assert.java:1577)
	at org.testng.Assert.assertEqualsImpl(Assert.java:149)
	at org.testng.Assert.assertEquals(Assert.java:131)
	at org.testng.Assert.assertEquals(Assert.java:643)
	at org.apache.bookkeeper.mledger.impl.ManagedCursorTest.testSkipEntries(ManagedCursorTest.java:2136)

Summary

  • Fix race condition in ManagedCursorTest.testSkipEntries where the assertion on mark-delete position fails because TrimConsumedLedgers asynchronously advances it beyond the expected value.
  • Changed strict assertEquals to >= comparison since the mark-delete position can legitimately be advanced by the trim operation.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Your PR doesn't need any doc update)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Your PR changeserta existing doc and the changes are complete)

Matching PR in forked repository

No response

Tip

Add the labels ready-to-test and area/test to trigger the CI.

The test asserted an exact mark-delete position after skipEntries(),
but the async TrimConsumedLedgers operation can advance the position
further before the assertion runs. Use >= comparison instead.
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Mar 17, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.72%. Comparing base (7f6bc23) to head (4d881d1).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #25339       +/-   ##
=============================================
+ Coverage     37.45%   72.72%   +35.26%     
- Complexity    13161    33849    +20688     
=============================================
  Files          1897     1954       +57     
  Lines        150557   154745     +4188     
  Branches      17215    17709      +494     
=============================================
+ Hits          56398   112537    +56139     
+ Misses        86428    33172    -53256     
- Partials       7731     9036     +1305     
Flag Coverage Δ
inttests 25.63% <ø> (-0.41%) ⬇️
systests 22.52% <ø> (+0.02%) ⬆️
unittests 73.69% <ø> (+39.51%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1418 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lhotari lhotari merged commit 8114d5d into apache:master Mar 19, 2026
312 of 328 checks passed
@lhotari lhotari added this to the 4.2.0 milestone Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants