Skip to content

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented May 7, 2025

Motivation

After upgrading Mockito to 5.17, the test ManagedCursorTest.testLastActiveAfterResetCursor is very flaky.
There are two problems:

  • the result callback gets triggered before the last active timestamp is updated
  • the test assumes that calls will take more than 1 ms to complete

In addition, Pulsar CI is currently blocked since SchemaTest.testPendingQueueSizeIfIncompatible fails consistently. This issue is reported as #24262. To unblock Pulsar CI, the change is included in this PR.

Modifications

  • update the last active timestamp before triggering the callback in ManagedCursorImpl
  • add a 1 ms delay in the test code to ensure that the next timestamp is different than the current one
  • disable SchemaTest.testPendingQueueSizeIfIncompatible

Documentation

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

Copy link
Member

@thetumbled thetumbled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lhotari lhotari force-pushed the lh-fix-flaky-managedcursortest-testLastActiveAfterResetCursor branch from 3a6051c to 04cf6db Compare May 7, 2025 09:06
@lhotari lhotari changed the title [fix][test] Fix flaky ManagedCursorTest.testLastActiveAfterResetCursor [fix][test] Fix flaky ManagedCursorTest.testLastActiveAfterResetCursor and disable failing SchemaTest May 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.23%. Comparing base (bbc6224) to head (04cf6db).
Report is 1080 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24261      +/-   ##
============================================
+ Coverage     73.57%   74.23%   +0.65%     
+ Complexity    32624    32593      -31     
============================================
  Files          1877     1866      -11     
  Lines        139502   145040    +5538     
  Branches      15299    16577    +1278     
============================================
+ Hits         102638   107664    +5026     
+ Misses        28908    28850      -58     
- Partials       7956     8526     +570     
Flag Coverage Δ
inttests 26.78% <100.00%> (+2.20%) ⬆️
systests 23.29% <100.00%> (-1.03%) ⬇️
unittests 73.72% <100.00%> (+0.87%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...che/bookkeeper/mledger/impl/ManagedCursorImpl.java 79.16% <100.00%> (-0.14%) ⬇️

... and 1083 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 616c3a1 into apache:master May 7, 2025
56 checks passed
lhotari added a commit that referenced this pull request May 9, 2025
…r and disable failing SchemaTest (#24261)

(cherry picked from commit 616c3a1)
lhotari added a commit that referenced this pull request May 9, 2025
…r and disable failing SchemaTest (#24261)

(cherry picked from commit 616c3a1)
lhotari added a commit that referenced this pull request May 9, 2025
…r and disable failing SchemaTest (#24261)

(cherry picked from commit 616c3a1)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 14, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 4e2047b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 14, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 14, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 4e2047b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 14, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 15, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request May 15, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 16, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 16, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 6eb7f7b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 18, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
(cherry picked from commit 4e2047b)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 28, 2025
…r and disable failing SchemaTest (apache#24261)

(cherry picked from commit 616c3a1)
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.

5 participants