Skip to content

Commit

Permalink
Automatic merge of master into galahad
Browse files Browse the repository at this point in the history
  • Loading branch information
OracleLabsAutomation committed Oct 22, 2024
2 parents be09613 + 2a0f45b commit 4bdec22
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ protected void run(StructuredGraph graph, LowTierContext context) {
*/
public static final int SLEEP_SECONDS = 10;

/**
* Thread.sleep is using nanoTime and compilation alarm uses System.currenTimeMillis which is a
* different timer so there can be small imprecision. We allow this amount milliseconds total
* imprecision.
*/
public static final int IMPRECISION_DELTA = 100;

@Test
public void testTimeOutRetryToString() {
final double secondsToWait = 1D;
Expand All @@ -103,9 +96,7 @@ public void testTimeOutRetryToString() {
duration += c;
index++;
}
final double scaledSecondsToWait = CompilationAlarm.scaleExpirationPeriod(secondsToWait, opt);
assert Integer.parseInt(duration) >= (scaledSecondsToWait * 1000) -
IMPRECISION_DELTA : String.format("Must at least wait for 2000ms but waited %s error was %s", duration, message);
assert Integer.parseInt(duration) > 0 : String.format("Must at least wait some positive amount of time but waited %s error was %s", duration, message);
}
}

Expand Down

0 comments on commit 4bdec22

Please sign in to comment.