Skip to content

Commit 633f76c

Browse files
Bouncheckavelanarius
authored andcommitted
Fix ChannelPoolInitTest NullPointerException
It seems that there was a race condition where we try to inspect `ChannelSet` while it is still null and `initialized` property is still false. This small reordering ensures that `initialize()` method of `ChannelPool` has been already called, because channelOpened event already fired.
1 parent 597f0c8 commit 633f76c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: core/src/test/java/com/datastax/oss/driver/internal/core/pool/ChannelPoolInitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ public void should_reconnect_when_init_incomplete() throws Exception {
177177
// A reconnection should have been scheduled
178178
verify(reconnectionSchedule, VERIFY_TIMEOUT).nextDelay();
179179
inOrder.verify(eventBus, VERIFY_TIMEOUT).fire(ChannelEvent.reconnectionStarted(node));
180-
assertThat(pool.channels[0]).containsOnly(channel1);
181180
inOrder.verify(eventBus, VERIFY_TIMEOUT).fire(ChannelEvent.channelOpened(node));
181+
assertThat(pool.channels[0]).containsOnly(channel1);
182182

183183
channel2Future.complete(channel2);
184184
factoryHelper.waitForCalls(node, 1);

0 commit comments

Comments
 (0)