Skip to content

Conversation

@RobertIndie
Copy link
Member

Fixes #22345

Motivation

Root cause analysis

Actually, the ledger will roll over here because it will fill up the current ledger:

Therefore, the source ML will update the managed ledger info. And the shadowML will get the updated MLInfo and update the LCE. So the assertion here is incorrect because the LCE will be updated:

// The state should not be the same.
log.info("Source.LCE={},Shadow.LCE={}", sourceML.lastConfirmedEntry, shadowML.lastConfirmedEntry);
assertNotEquals(sourceML.lastConfirmedEntry, shadowML.lastConfirmedEntry);

The process of updating MLInfo from sourceML to shadowML is asynchronous. This causes the test to be unreliable.

Regarding the change for this:

Awaitility.await().untilAsserted(() -> {
assertEquals(shadowML.ledgers.size(), 6);
assertEquals(shadowML.currentLedgerEntries, 0);
});

We have removed one entry addition operation in the test. Therefore, the final count for the ledger size will be one less.

Modifications

  • Remove incorrect assertions from the tests
  • Improve the test by using Awaitility
  • Move the tests out of flaky group

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@RobertIndie RobertIndie added type/bug The PR fixed a bug or issue reported a bug type/flaky-tests labels May 20, 2024
@RobertIndie RobertIndie added this to the 3.4.0 milestone May 20, 2024
@RobertIndie RobertIndie self-assigned this May 20, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label May 20, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.22%. Comparing base (bbc6224) to head (bc6c276).
⚠️ Report is 1253 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22745      +/-   ##
============================================
- Coverage     73.57%   73.22%   -0.35%     
+ Complexity    32624     2413   -30211     
============================================
  Files          1877     1889      +12     
  Lines        139502   141419    +1917     
  Branches      15299    15518     +219     
============================================
+ Hits         102638   103558     +920     
- Misses        28908    29859     +951     
- Partials       7956     8002      +46     
Flag Coverage Δ
inttests 27.48% <ø> (+2.90%) ⬆️
systests 24.72% <ø> (+0.39%) ⬆️
unittests 72.23% <ø> (-0.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 365 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.

@merlimat merlimat merged commit 99bff72 into apache:master May 23, 2024
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs type/bug The PR fixed a bug or issue reported a bug type/flaky-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky-test: ShadowManagedLedgerImplTest.testShadowWrites

4 participants