Skip to content

Commit 436900e

Browse files
committed
test: fix thread leak in StreamingSubscriberConnectionTest and make threadB daemon in ClientConfigurationManagerTest
1 parent c4e3e7c commit 436900e

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/util/ClientConfigurationManagerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ public void onChange(SessionClientConfiguration newValue) {
359359
}
360360
}
361361
});
362+
threadB.setDaemon(true);
362363
threadB.start();
363364

364365
// Wait for Thread B to acquire the alien lock

java-pubsub/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnectionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ public class StreamingSubscriberConnectionTest {
101101
@Before
102102
public void setUp() {
103103
systemExecutor = new FakeScheduledExecutorService();
104+
executor = new FakeScheduledExecutorService();
104105
clock = systemExecutor.getClock();
105106
mockSubscriberStub = mock(SubscriberStub.class, RETURNS_DEEP_STUBS);
106107
}
107108

108109
@After
109110
public void tearDown() {
110111
systemExecutor.shutdown();
112+
executor.shutdown();
111113
}
112114

113115
@Test

0 commit comments

Comments
 (0)