Skip to content

[fix][test] Fix NPE in BookKeeperClusterTestCase tearDown#22493

Merged
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-BookKeeperClusterTestCase-NPE
Apr 12, 2024
Merged

[fix][test] Fix NPE in BookKeeperClusterTestCase tearDown#22493
lhotari merged 1 commit into
apache:masterfrom
lhotari:lh-fix-BookKeeperClusterTestCase-NPE

Conversation

@lhotari

@lhotari lhotari commented Apr 12, 2024

Copy link
Copy Markdown
Member

Motivation

  • impacts ManagedLedgerBkTest.tearDown and ManagedLedgerFactoryChangeLedgerPathTest.tearDown
  Error:  Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.278 s <<< FAILURE! - in org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryChangeLedgerPathTest
  Error:  org.apache.bookkeeper.mledger.impl.ManagedLedgerFactoryChangeLedgerPathTest.tearDown  Time elapsed: 0.186 s  <<< FAILURE!
  java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ExecutorService.shutdownNow()" because "this.executor" is null
  	at org.apache.bookkeeper.test.BookKeeperClusterTestCase.tearDown(BookKeeperClusterTestCase.java:225)

and

  Error:  Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.573 s <<< FAILURE! - in org.apache.bookkeeper.mledger.impl.ManagedLedgerBkTest
  Error:  org.apache.bookkeeper.mledger.impl.ManagedLedgerBkTest.tearDown  Time elapsed: 0.446 s  <<< FAILURE!
  java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ExecutorService.shutdownNow()" because "this.executor" is null
  	at org.apache.bookkeeper.test.BookKeeperClusterTestCase.tearDown(BookKeeperClusterTestCase.java:225)

Modifications

  • add null check
  • add alwaysRun=true to Before* methods

Documentation

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

- impacts ManagedLedgerBkTest.tearDown and ManagedLedgerFactoryChangeLedgerPathTest.tearDown
@lhotari lhotari added this to the 3.3.0 milestone Apr 12, 2024
@lhotari lhotari self-assigned this Apr 12, 2024
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Apr 12, 2024
@BewareMyPower

Copy link
Copy Markdown
Contributor

I remember your mentioned the similar issue in my PR before but I still didn't get in which case BeforeClass method is not called.

@lhotari

lhotari commented Apr 12, 2024

Copy link
Copy Markdown
Member Author

I remember your mentioned the similar issue in my PR before but I still didn't get in which case BeforeClass method is not called.

Yes, there is something odd here since I wouldn't expect this class to be part of flaky tests.

@lhotari lhotari merged commit d174857 into apache:master Apr 12, 2024
lhotari added a commit that referenced this pull request May 14, 2024
lhotari added a commit that referenced this pull request May 14, 2024
nikhil-ctds pushed a commit to datastax/pulsar that referenced this pull request May 15, 2024
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request May 16, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants