From d74d134698ce381b5d18d6c71815f5042ffd1816 Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Wed, 26 Aug 2015 19:25:47 +0200 Subject: [PATCH] Removing unit test that was covering the resolution of the nano time - The difference between 2 consecultive calls to System.nanoTime() returns a resolution that depends on the OS implementation. Due to that, the test was failing in an inttermmitent manner - Today we decided to remove the test since it was not testing a direct feature of ACS --- .../test/java/com/cloud/utils/TestProfiler.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/utils/src/test/java/com/cloud/utils/TestProfiler.java b/utils/src/test/java/com/cloud/utils/TestProfiler.java index 2306cd75520..25b651844bd 100644 --- a/utils/src/test/java/com/cloud/utils/TestProfiler.java +++ b/utils/src/test/java/com/cloud/utils/TestProfiler.java @@ -96,21 +96,4 @@ public class TestProfiler extends Log4jEnabledTestCase { Assert.assertTrue(pf.getDurationInMillis() == -1); Assert.assertFalse(pf.isStopped()); } - - @Test - public void testResolution() { - long nanoTime1 = 0l; - long nanoTime2 = 0l; - nanoTime1 = System.nanoTime(); - nanoTime2 = System.nanoTime(); - - // Using sysout here because is faster than the logger and we don't want to - // waste time. - System.out.println("Nano time 1: " + nanoTime1); - System.out.println("Nano time 2: " + nanoTime2); - - // We are measuring the elapsed time in 2 consecutive calls of System.nanoTime() - // That's the same as 0.002 milliseconds or 2000 nanoseconds. - Assert.assertTrue("Expected exactly 2 but it took more than 3 microseconds between 2 consecutive calls to System.nanoTime().", nanoTime2 - nanoTime1 <= 3000); - } } \ No newline at end of file