Skip to content

Conversation

@poorbarcode
Copy link
Contributor

@poorbarcode poorbarcode commented Jul 29, 2022

Fixes #9919

Master Issue: #9919

Motivation

This problem was marked as resolved, but it still exists.

recent failure: https://github.com/apache/pulsar/runs/7564370916?check_suite_focus=true#step:10:950

and this one: https://github.com/apache/pulsar/pull/16841/checks?check_run_id=7566225112

Why is this test flaky?

  • The ledgerHandle of the cursor, is not accurately closed, even if it is closed, there is no guarantee that ledgerHandle created will occur after cursor.persistentToLedger.

for(PulsarMockLedgerHandle ledgerHandle : mockBookKeeper.getLedgerMap().values()) {
ledgerHandle.close();
}

  • This line of below could not guarantee that cursor.persistentToLedger has been completed, only that the client has received a response.

Awaitility.await().until(() -> pulsarClient.getConnection(topicName).get().getPendingRequests().size() == 0);

Modifications

These following changes in this PR (High light):

  1. Fixed flaky test ManagedCursorMetricsTest.testManagedCursorMetrics.
  2. Add more test cases. Only brk_ml_cursor_persistZookeeperErrors is left incomplete now, I write the reason in the code comment.
  3. Improves performance, use @BeforeClass instead of @BeforeMethod(alwaysRun=true)

Documentation

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

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 29, 2022
@poorbarcode poorbarcode force-pushed the fix/flaky/cursorMetrics branch from 5c9efa1 to 09feb44 Compare July 29, 2022 20:47
@poorbarcode
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@poorbarcode
Copy link
Contributor Author

@lhotari Could you take a look ?

@Jason918
Copy link
Contributor

Jason918 commented Sep 2, 2022

@poorbarcode Can you help open a new PR to merge this to branch-2.10?

@poorbarcode
Copy link
Contributor Author

Hi @Jason918

Can you help open a new PR to merge this to branch-2.10?

yes, it is #17504. Note that the branch-master logic changes cause the test code for branch-2.10 to be a little different

@poorbarcode poorbarcode deleted the fix/flaky/cursorMetrics branch September 17, 2022 02:50
congbobo184 pushed a commit that referenced this pull request Nov 11, 2022
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 11, 2022
congbobo184 pushed a commit that referenced this pull request Dec 7, 2022
congbobo184 added a commit that referenced this pull request Dec 7, 2022
### Motivation
fix cherry-pick #17609 import
fix cherry-pick #17957  import
fix cherry-pick #16878 lose problem
fix cherry-pick #17503 problem
liangyepianzhou pushed a commit that referenced this pull request Dec 14, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
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.

Flaky-test: ManagedCursorMetricsTest.testCursorReadWriteMetrics Flaky-test: ManagedCursorMetricsTest.testManagedCursorMetrics

6 participants