Skip to content

Commit

Permalink
Merge branch 'elasticity' into 4246-fate-create-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Aug 5, 2024
2 parents 5a656ec + f5b08c6 commit 90023e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,8 @@ public static boolean isValidTablePropertyKey(String key) {
COMPACTOR_MINTHREADS_TIMEOUT,

// others
TSERV_NATIVEMAP_ENABLED, TSERV_SCAN_MAX_OPENFILES, MANAGER_RECOVERY_WAL_EXISTENCE_CACHE_TIME);
TSERV_NATIVEMAP_ENABLED, TSERV_SCAN_MAX_OPENFILES, MANAGER_RECOVERY_WAL_EXISTENCE_CACHE_TIME,
TSERV_SESSION_MAXIDLE, TSERV_UPDATE_SESSION_MAXIDLE);

/**
* Checks if the given property may be changed via Zookeeper, but not recognized until the restart
Expand Down
24 changes: 7 additions & 17 deletions core/src/test/java/org/apache/accumulo/core/util/TimerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ public void testHasElapsed() throws InterruptedException {

assertTrue(timer.hasElapsed(Duration.ofMillis(50)),
"The timer should indicate that 50 milliseconds have elapsed.");
assertFalse(timer.hasElapsed(Duration.ofMillis(100)),
"The timer should not indicate that 100 milliseconds have elapsed.");
}

@Test
Expand All @@ -77,33 +75,25 @@ public void testHasElapsedWithTimeUnit() throws InterruptedException {

assertTrue(timer.hasElapsed(50, MILLISECONDS),
"The timer should indicate that 50 milliseconds have elapsed.");
assertFalse(timer.hasElapsed(100, MILLISECONDS),
"The timer should not indicate that 100 milliseconds have elapsed.");
}

@Test
public void testElapsedPrecision() throws InterruptedException {
public void testElapsedWithTimeUnit() throws InterruptedException {
Timer timer = Timer.startNew();

final int sleepMillis = 50;
Thread.sleep(sleepMillis);

long elapsedMillis = timer.elapsed(MILLISECONDS);
assertEquals(sleepMillis, elapsedMillis, 5, "Elapsed time in milliseconds is not accurate.");
}

@Test
public void testElapsedWithTimeUnit() throws InterruptedException {
Timer timer = Timer.startNew();

Thread.sleep(50);
assertTrue(elapsedMillis >= sleepMillis, "Elapsed time in milliseconds is not correct.");

long elapsedMillis = timer.elapsed(MILLISECONDS);
assertEquals(50, elapsedMillis, 5, "Elapsed time in milliseconds is not accurate.");
if (elapsedMillis < 1000) {
long elapsedSeconds = timer.elapsed(TimeUnit.SECONDS);
assertEquals(0, elapsedSeconds,
"Elapsed time in seconds should be 0 for 50 milliseconds of sleep.");
}

long elapsedSeconds = timer.elapsed(TimeUnit.SECONDS);
assertEquals(0, elapsedSeconds,
"Elapsed time in seconds should be 0 for 50 milliseconds of sleep.");
}

}

0 comments on commit 90023e5

Please sign in to comment.