Skip to content
Permalink
Browse files
Fix tests (again, failing on GH, ok, locally).
  • Loading branch information
Gary Gregory committed Aug 13, 2021
1 parent 4cdc2ca commit 84ac062960996efb5701a5a85f39f8a818082e15
Showing 1 changed file with 9 additions and 2 deletions.
@@ -1041,11 +1041,15 @@ public void testBorrowTimings() throws Exception {
// Sleep MUST be "long enough" to detect that more than 0 milliseconds have elapsed.
// Need an API in Java 8 to get the clock granularity.
Thread.sleep(200);

assertFalse(dpo.getActiveDuration().isNegative());
assertFalse(dpo.getActiveDuration().isZero());
assertThat(dpo.getActiveDuration(), lessThanOrEqualTo(dpo.getIdleDuration()));
// Depreacted
assertThat(dpo.getActiveDuration().toMillis(), lessThanOrEqualTo(dpo.getActiveTimeMillis()));
assertThat(dpo.getActiveDuration(), lessThanOrEqualTo(dpo.getActiveTime()));
assertThat(dpo.getActiveDuration(), lessThanOrEqualTo(dpo.getIdleDuration()));
assertThat(dpo.getActiveDuration(), lessThanOrEqualTo(dpo.getIdleTime()));
assertThat(dpo.getActiveDuration().toMillis(), lessThanOrEqualTo(dpo.getIdleTimeMillis()));
//
assertThat(dpo.getCreateInstant(), lessThanOrEqualTo(dpo.getLastBorrowInstant()));
assertThat(dpo.getCreateInstant(), lessThanOrEqualTo(dpo.getLastReturnInstant()));
@@ -1055,13 +1059,16 @@ public void testBorrowTimings() throws Exception {
assertThat(lastReturnInstant1, lessThanOrEqualTo(dpo.getLastReturnInstant()));
assertThat(lastUsedInstant1, lessThanOrEqualTo(dpo.getLastUsedInstant()));

// Return
genericObjectPool.returnObject(object);

assertFalse(dpo.getActiveDuration().isNegative());
assertFalse(dpo.getActiveDuration().isZero());
assertThat(dpo.getActiveDuration().toMillis(), lessThanOrEqualTo(dpo.getActiveTimeMillis()));
assertThat(dpo.getActiveDuration(), lessThanOrEqualTo(dpo.getActiveTime()));

assertThat(lastBorrowInstant1, lessThanOrEqualTo(dpo.getLastBorrowInstant()));
assertThat(lastReturnInstant1, lessThanOrEqualTo(dpo.getLastReturnInstant()));
assertThat(lastUsedInstant1, lessThanOrEqualTo(dpo.getLastUsedInstant()));
}

/*

0 comments on commit 84ac062

Please sign in to comment.