You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/05/06 16:08:34 UTC

[PR] [fix][test] Fix TestNG BetweenTestClassesListenerAdapter listener [pulsar]

lhotari opened a new pull request, #24258:
URL: https://github.com/apache/pulsar/pull/24258

   ### Motivation
   
   In TestNG, there's no readily available way to reliably detect when all tests defined in a single test class have all been executed. That's why BetweenTestClassesListenerAdapter listener has been added a long time ago to execute certain cleanup operations between test classes.
   
   One of the cleanup operations is to cleanup Mockito mocks between test classes so that memory isn't leaked during the test run. 
   
   The previous solution was causing issues in Mockito 5.17 upgrade PR since the "between class" got detected after the next test class had already been initialized. This caused issues with some tests which initialized test mocks in constructor.
   
   ### Modifications
   
   - change the way how test class completion is detected in BetweenTestClassesListenerAdapter
   - add unit tests for different types of TestNG test classes to ensure correct behavior
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][test] Fix TestNG BetweenTestClassesListenerAdapter listener [pulsar]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #24258:
URL: https://github.com/apache/pulsar/pull/24258#issuecomment-2855382828

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/24258?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 74.16%. Comparing base [(`bbc6224`)](https://app.codecov.io/gh/apache/pulsar/commit/bbc62245c5ddba1de4b1e7cee4ab49334bc36277?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`890e02a`)](https://app.codecov.io/gh/apache/pulsar/commit/890e02a715b21abf8e1ffcb64cc9d2dcf022695e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 1068 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/24258/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/24258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #24258      +/-   ##
   ============================================
   + Coverage     73.57%   74.16%   +0.58%     
   + Complexity    32624    32561      -63     
   ============================================
     Files          1877     1866      -11     
     Lines        139502   144968    +5466     
     Branches      15299    16561    +1262     
   ============================================
   + Hits         102638   107512    +4874     
   - Misses        28908    28930      +22     
   - Partials       7956     8526     +570     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/24258/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/24258/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.74% <ø> (+2.16%)` | :arrow_up: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/24258/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.28% <ø> (-1.05%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/24258/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.65% <ø> (+0.80%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   [see 1080 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/24258/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [fix][test] Fix TestNG BetweenTestClassesListenerAdapter listener [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari merged PR #24258:
URL: https://github.com/apache/pulsar/pull/24258


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org