Elffuss BraidHub

kikocis/java-driver public

Fix some timing and protocol version issues in Integration Tests.

Fixes timing issue in RecommissionedNodeTest by giving the Driver time
to mark a node down as it is additionally in an 'ADDED' state on connect
and will be marked down as soon as we detect invalid cluster
name/version.

Sets protocol version explicitly in
ReconnectionTest#should_use_connection_from_reconnection_in_pool so we
do not need to account for a possible reconnection(s) to demote the
protocol version.
Changesetd5dbc139ebbea4d2db4a04b8e0ff63038dfc9be9874bdc8b7c4a4b5d706f6d05
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-05-12 16:42 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-05-12 16:42 -05:00
Parents5b2ba50eec1f

Browse the files at this changeset

2 files changed

modified driver-core/src/test/java/com/datastax/driver/core/RecommissionedNodeTest.java +2 −0
@@ -110,6 +110,7 @@
110110
111111 // Node 1 should now be DOWN with no reconnection attempt
112112 assertThat(mainCluster).host(1)
113+ .goesDownWithin(10, TimeUnit.SECONDS)
113114 .hasState(DOWN)
114115 .isNotReconnectingFromDown();
115116 }
@@ -133,6 +134,7 @@
133134
134135 // Node 1 should now be DOWN with no reconnection attempt
135136 assertThat(mainCluster).host(1)
137+ .goesDownWithin(10, TimeUnit.SECONDS)
136138 .hasState(DOWN)
137139 .isNotReconnectingFromDown();
138140 }
modified driver-core/src/test/java/com/datastax/driver/core/ReconnectionTest.java +1 −0
@@ -262,6 +262,7 @@
262262 .withReconnectionPolicy(new ConstantReconnectionPolicy(5000))
263263 .withLoadBalancingPolicy(loadBalancingPolicy)
264264 .withSocketOptions(socketOptions)
265+ .withProtocolVersion(TestUtils.getDesiredProtocolVersion())
265266 .build();
266267 // Create two sessions to have multiple pools
267268 cluster.connect();