Skip to content
Browse files

For some unknown reason #testDiskSyncPerformance fails when executed …

…from within IntelliJ IDEA. Added a todo-note of that in the class and appended it as a message to the the assert fail message.
  • Loading branch information...
1 parent 288dc96 commit a78d28c14ccfd471bf7cbe70502fe65994b53cb8 Karl Wettin committed Oct 31, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 tests/src/test/java/org/prevayler/implementation/PersistenceTest.java
View
12 tests/src/test/java/org/prevayler/implementation/PersistenceTest.java
@@ -96,22 +96,28 @@ public void testDiskSyncPerformance() throws Exception {
long true2 = doDiskSyncPerformanceRun(true);
long bestTrue = Math.min(true1, true2);
long worstFalse = Math.max(false1, false2);
- assertTrue(bestTrue + " should be worse than " + worstFalse, bestTrue > worstFalse);
+ // todo: This fails when executing the test from within IntelliJ IDEA
+ // todo: but not when executed from command line.
+ assertTrue(bestTrue + " should be worse than " + worstFalse + " (This test has been seen failing when executed from within IntelliJ IDEA, but should never fail when executed from command line using 'mvn install'.)", bestTrue > worstFalse);
}
private long doDiskSyncPerformanceRun(boolean journalDiskSync) throws Exception {
+
newPrevalenceBase();
crashRecover(journalDiskSync);
append("a", "a");
- long start = System.currentTimeMillis();
+ long start = System.nanoTime();
String expected = "a";
+
for (char c = 'b'; c <= 'z'; c++) {
expected += c;
append(String.valueOf(c), expected);
}
- long end = System.currentTimeMillis();
+
+ long end = System.nanoTime();
crashRecover(journalDiskSync);
verify(expected);
+
return end - start;
}

0 comments on commit a78d28c

Please sign in to comment.
Something went wrong with that request. Please try again.