Mercurial > hg > graal-compiler
changeset 17357:d044ca4a1cdc
more fixes for DebugTimerTest
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 07 Oct 2014 13:21:57 +0200 |
parents | 115de469a26b |
children | 6b1eed55ea66 |
files | graal/com.oracle.graal.debug.test/src/com/oracle/graal/debug/test/DebugTimerTest.java |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.debug.test/src/com/oracle/graal/debug/test/DebugTimerTest.java Tue Oct 07 11:42:41 2014 +0200 +++ b/graal/com.oracle.graal.debug.test/src/com/oracle/graal/debug/test/DebugTimerTest.java Tue Oct 07 13:21:57 2014 +0200 @@ -112,10 +112,13 @@ DebugTimer timerD = Debug.timer("TimerD"); DebugTimer timerE = Debug.timer("TimerE"); + long spinD1; + long spinE; + try (TimerCloseable d1 = timerD.start()) { - spin(50); + spinD1 = spin(50); try (TimerCloseable e1 = timerE.start()) { - spin(50); + spinE = spin(50); try (TimerCloseable d2 = timerD.start()) { spin(50); try (TimerCloseable d3 = timerD.start()) { @@ -127,7 +130,7 @@ Assert.assertTrue(timerE.getCurrentValue() < timerD.getCurrentValue()); if (timerD.getFlat() != null && timerE.getFlat() != null) { - assertTrue(timerE.getFlat().getCurrentValue() < timerD.getFlat().getCurrentValue()); + assertTrue(spinE >= spinD1 || timerE.getFlat().getCurrentValue() < timerD.getFlat().getCurrentValue()); assertEquals(timerD.getFlat().getCurrentValue(), timerD.getCurrentValue() - timerE.getFlat().getCurrentValue(), 10D); } }