kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | d68e339cb5b7e7e015bdd83f40dbed2d86a35cd493fd8605bc4653285ed3a65f |
|---|---|
| Author | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-01-30 18:21 -06:00 |
| Committer | Andrew Tolbert <andrew.tolbert@datastax.com> · 2015-02-13 07:23 -06:00 |
| Parents | d8c184a6e782 |
1 file changed
modified driver-core/src/test/java/com/datastax/driver/core/TestUtils.java +6 −4
| @@ -49,6 +49,8 @@ | ||
| 49 | 49 | public static final String INSERT_FORMAT = "INSERT INTO %s (k, t, i, f) VALUES ('%s', '%s', %d, %f)"; |
| 50 | 50 | public static final String SELECT_ALL_FORMAT = "SELECT * FROM %s"; |
| 51 | 51 | |
| 52 | + public static final int TEST_BASE_NODE_WAIT = SystemProperties.getInt("com.datastax.driver.TEST_BASE_NODE_WAIT", 60); | |
| 53 | + | |
| 52 | 54 | @SuppressWarnings({ "unchecked", "rawtypes" }) |
| 53 | 55 | public static BoundStatement setBoundValue(BoundStatement bs, String name, DataType type, Object value) { |
| 54 | 56 | switch (type.getName()) { |
| @@ -267,7 +269,7 @@ | ||
| 267 | 269 | // This is used because there is some delay between when a node has been |
| 268 | 270 | // added through ccm and when it's actually available for querying |
| 269 | 271 | public static void waitFor(String node, Cluster cluster) { |
| 270 | - waitFor(node, cluster, 60, false, false); | |
| 272 | + waitFor(node, cluster, TEST_BASE_NODE_WAIT, false, false); | |
| 271 | 273 | } |
| 272 | 274 | |
| 273 | 275 | public static void waitFor(String node, Cluster cluster, int maxTry) { |
| @@ -275,11 +277,11 @@ | ||
| 275 | 277 | } |
| 276 | 278 | |
| 277 | 279 | public static void waitForDown(String node, Cluster cluster) { |
| 278 | - waitFor(node, cluster, 180, true, false); | |
| 280 | + waitFor(node, cluster, TEST_BASE_NODE_WAIT * 3, true, false); | |
| 279 | 281 | } |
| 280 | 282 | |
| 281 | 283 | public static void waitForDownWithWait(String node, Cluster cluster, int waitTime) { |
| 282 | - waitFor(node, cluster, 180, true, false); | |
| 284 | + waitForDown(node, cluster); | |
| 283 | 285 | |
| 284 | 286 | // FIXME: Once stop() works, remove this line |
| 285 | 287 | try { |
| @@ -299,7 +301,7 @@ | ||
| 299 | 301 | } |
| 300 | 302 | |
| 301 | 303 | public static void waitForDecommission(String node, Cluster cluster) { |
| 302 | - waitFor(node, cluster, 30, true, true); | |
| 304 | + waitFor(node, cluster, TEST_BASE_NODE_WAIT / 2, true, true); | |
| 303 | 305 | } |
| 304 | 306 | |
| 305 | 307 | public static void waitForDecommission(String node, Cluster cluster, int maxTry) { |