Skip to content

Commit

Permalink
[fix][test] Fix some resource leaks in compaction tests (#21374)
Browse files Browse the repository at this point in the history
(cherry picked from commit e6cd11f)

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java
  • Loading branch information
lhotari committed Oct 17, 2023
1 parent d7ca04b commit 215f421
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public void cleanup() throws Exception {

@Test
public void testEntryLookup() throws Exception {
@Cleanup
BookKeeper bk = pulsar.getBookKeeperClientFactory().create(
this.conf, null, null, Optional.empty(), null);

Expand Down Expand Up @@ -219,6 +220,7 @@ public void testEntryLookup() throws Exception {

@Test
public void testCleanupOldCompactedTopicLedger() throws Exception {
@Cleanup
BookKeeper bk = pulsar.getBookKeeperClientFactory().create(
this.conf, null, null, Optional.empty(), null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void setup() throws Exception {
@Override
public void cleanup() throws Exception {
super.internalCleanup();

bk.close();
if (compactionScheduler != null) {
compactionScheduler.shutdownNow();
}
Expand Down

0 comments on commit 215f421

Please sign in to comment.