Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][test] Don't configure Mockito spying for MultiBrokerTestZKBaseTest #22250

Merged
merged 1 commit into from
Mar 12, 2024

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 Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.64%. Comparing base (bbc6224) to head (f49fdca).
Report is 36 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

@lhotari lhotari merged commit 9f63e24 into apache:master Mar 12, 2024
57 of 60 checks passed
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
3 participants