Elffuss BraidHub

kikocis/java-driver public

Base wait times in PoolingOptionsTest on NEW_NODE_DELAY_SECONDS.

Wait for NEW_NODE_DELAY_SECONDS instead of hard coded value since this
is the amount of time that the driver has to establish a connection
pool and set a host as up.
Changesetd8c184a6e782ed7503df8d3d66ae62d5f88b2be6f36de890a8dc7feec08ee6fd
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-01-30 18:19 -06:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2015-02-13 07:23 -06:00
Parentsa5cf2157144a

Browse the files at this changeset

1 file changed

modified driver-core/src/test/java/com/datastax/driver/core/PoolingOptionsTest.java +4 −3
@@ -48,8 +48,9 @@
4848 .hasState(State.UP)
4949 .isAtDistance(HostDistance.LOCAL);
5050 // Wait for the node to be up, because apparently on Jenkins it's still only ADDED when we reach this line
51+ // Waiting for NEW_NODE_DELAY_SECONDS+1 allows the driver to create a connection pool and mark the node up
5152 assertThat(cluster).host(2)
52- .comesUpWithin(120, SECONDS)
53+ .comesUpWithin(Cluster.NEW_NODE_DELAY_SECONDS+1, SECONDS)
5354 .isAtDistance(HostDistance.LOCAL);
5455
5556 // Bring host 3 up, its presence should be acknowledged but it should be ignored
@@ -63,13 +64,13 @@
6364 .hasState(State.UP)
6465 .isAtDistance(HostDistance.LOCAL);
6566 assertThat(cluster).host(3)
66- .comesUpWithin(120, SECONDS)
67+ .comesUpWithin(Cluster.NEW_NODE_DELAY_SECONDS+1, SECONDS)
6768 .isAtDistance(HostDistance.IGNORED);
6869 assertThat(session).hasNoPoolFor(3);
6970
7071 // Kill host 2, host 3 should take its place
7172 ccm.stop(2);
72- TestUtils.waitFor(CCMBridge.ipOfNode(3), cluster, 120);
73+ TestUtils.waitFor(CCMBridge.ipOfNode(3), cluster);
7374
7475 assertThat(cluster).host(1)
7576 .hasState(State.UP)