Skip to content

Commit

Permalink
Merge pull request #1842 from dedis/java_update_interval_1841
Browse files Browse the repository at this point in the history
Fix updateInterval and updateRoster tests in the Java library
  • Loading branch information
Jeff R. Allen committed May 1, 2019
2 parents 61f8f4e + 9d45470 commit 9614ad9
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ void updateInterval() throws Exception {
Instant now = Instant.now();
counters.increment();
bc.getGenesisDarcInstance().evolveDarcAndWait(bc.getGenesisDarc(), admin, counters.head(), 10);
assertTrue(Duration.between(now, Instant.now()).toMillis() > 5000-100);
// check if the interval has changed (but doesn't check the interval is exactly the one requested)
// because it's too sensible for a precise test. There is an undetermined time after the block is
// created and the wait returns that cannot be quantity.
assertTrue(Duration.between(now, Instant.now()).toMillis() > BLOCK_INTERVAL.toMillis() + 500);


// Need to set the blockInterval back manually, else it will complain.
Expand Down Expand Up @@ -448,17 +451,16 @@ void updateRoster() throws Exception {
bc.setMaxBlockSize(1000 * 1000, admins, counters.getCounters(), 20);
counters.increment();

// This should work - why does it fail?
logger.info("shutting down two nodes and it should still run");
try {
testInstanceController.killConode(3);
// here we kill only the 4th conode to avoid killing a subleader because we use a
// small interval in the tests
testInstanceController.killConode(4);
bc.setMaxBlockSize(1000 * 1000, admins, counters.getCounters(), 12);
counters.increment();
} finally {
// Start nodes 3 and 4 again
// Start node again
logger.info("Starting conodes to make sure everything's OK for next tests");
testInstanceController.startConode(3);
testInstanceController.startConode(4);
}

Expand Down

0 comments on commit 9614ad9

Please sign in to comment.