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.
Changesetef28ab8897d2889c4250c76b77042c819fe62a329590538f6a220e3cdd1857de
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-05-12 16:42 -05:00
Committerolim7t <omichallat+github@gmail.com> · 2015-05-14 16:32 +02:00
Parentsf416c4cda74f

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();