Skip to content

Commit 5f856df

Browse files
adutratolbertam
authored andcommitted
Fix failing test after JAVA-1431 (apache#855)
1 parent 5b9b13b commit 5f856df

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

driver-core/src/test/java/com/datastax/driver/core/SessionErrorTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public void should_not_propagate_unchecked_exceptions() {
8686
// but its pool should have no active connection
8787
// Pool to host2 should have been closed because host2 has no
8888
// more active connections
89-
Session.State state = session.getState();
9089
Host host1 = scassandra.host(cluster, 1, 1);
9190
Host host2 = scassandra.host(cluster, 1, 2);
92-
assertThat(state.getConnectedHosts()).hasSize(1).containsExactly(host1);
91+
TestUtils.waitForDown(TestUtils.ipOfNode(2), cluster);
92+
Session.State state = session.getState();
9393
assertThat(state.getOpenConnections(host1)).isEqualTo(0); // pool open but empty
9494
assertThat(state.getOpenConnections(host2)).isEqualTo(0); // pool closed
9595
assertThat(logs.get())
@@ -98,6 +98,11 @@ public void should_not_propagate_unchecked_exceptions() {
9898
"not really",
9999
NullPointerException.class.getSimpleName(),
100100
"com.datastax.driver.core.Connection$4.apply");
101+
HostConnectionPool pool1 = ((SessionManager)session).pools.get(host1);
102+
HostConnectionPool pool2 = ((SessionManager)session).pools.get(host2);
103+
assertThat(pool1).isNotNull();
104+
assertThat(pool1.isClosed()).isFalse();
105+
assertThat(pool2).isNull(); // pool2 should have been removed
101106
} finally {
102107
TestUtils.setLogLevel(HostConnectionPool.class, previous);
103108
logs.disableFor(HostConnectionPool.class);

0 commit comments

Comments
 (0)