Skip to content

Commit

Permalink
[fix][test] Fix some resource leaks in compaction tests (apache#21374)
Browse files Browse the repository at this point in the history
lhotari authored Oct 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f5222d6 commit e6cd11f
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -161,6 +161,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);

@@ -216,6 +217,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);

@@ -845,6 +847,7 @@ public void testReadCompactedLatestMessageWithInclusive() throws Exception {

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

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

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

0 comments on commit e6cd11f

Please sign in to comment.