Skip to content

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Mar 12, 2024

Fixes #22239

Motivation

The AdvertisedListenersMultiBrokerLeaderElectionTest test is flaky since it times out.
I profiled the test with Async Profiler on Linux by adding this to pom.xml in <test.additional.args>

    <test.additional.args>
      -agentpath:/home/lari/tools/async-profiler-3.0-linux-x64/lib/libasyncProfiler.so=start,event=cpu,jfr,file=/tmp/profile${maven.build.timestamp}_${surefire.forkNumber}.jfr

and converting the .jfr file to .html with java -jar tools/async-profiler-3.0-macos/lib/converter.jar jfr2flame profile2024-03-12T10:44:25Z_1.jfr output.html and java -jar tools/async-profiler-3.0-macos/lib/converter.jar jfr2flame --threads profile2024-03-12T10:44:25Z_1.jfr output_threads.html.
In the profile, I could see that Mockito was causing a lot of overhead to the execution.

Modifications

  • add .spyNoneByDefault() to PulsarTestContext.Builder
  • use this in MultiBrokerTestZKBaseTest

Documentation

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

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.64%. Comparing base (bbc6224) to head (f49fdca).
Report is 1140 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22250      +/-   ##
============================================
+ Coverage     73.57%   73.64%   +0.06%     
+ Complexity    32624    32172     -452     
============================================
  Files          1877     1879       +2     
  Lines        139502   139793     +291     
  Branches      15299    15338      +39     
============================================
+ Hits         102638   102944     +306     
+ Misses        28908    28862      -46     
- Partials       7956     7987      +31     
Flag Coverage Δ
inttests 26.59% <ø> (+2.00%) ⬆️
systests 24.40% <ø> (+0.07%) ⬆️
unittests 72.89% <ø> (+0.04%) ⬆️

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

see 82 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 9f63e24 into apache:master Mar 12, 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 ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky-test: AdvertisedListenersMultiBrokerLeaderElectionTest.shouldProvideConsistentAnswerToTopicLookupsUsingAdminApi
3 participants