Skip to content
Snippets Groups Projects
Commit 0beaea1b authored by brinn's avatar brinn
Browse files

fix: relax the checks a bit to avoid failures in uncommon timing situations

SVN: 7050
parent 53d22a5c
No related branches found
No related tags found
No related merge requests found
......@@ -156,14 +156,14 @@ public class RemoteStoreCopyActivitySensorTest
ConcurrencyUtilities.sleep(10L);
final long now1 = System.currentTimeMillis();
final long lastActivity1 = sensorUnderTest.getTimeOfLastActivityMoreRecentThan(THRESHOLD);
assertEquals(now1, lastActivity1);
assertTrue("Delta=" + (lastActivity1 - now1), lastActivity1 - now1 < MAX_DELTA);
ConcurrencyUtilities.sleep(10L);
final long now2 = System.currentTimeMillis();
final long lastActivity2 = sensorUnderTest.getTimeOfLastActivityMoreRecentThan(THRESHOLD);
assertEquals(now2, lastActivity2);
assertTrue("Delta=" + (lastActivity2 - now2), lastActivity2 - now2 < MAX_DELTA);
ConcurrencyUtilities.sleep(10L);
final long lastActivity3 = sensorUnderTest.getTimeOfLastActivityMoreRecentThan(THRESHOLD);
assertEquals(now1, lastActivity3);
assertEquals(lastActivity1, lastActivity3);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment