tmf: fix test failures due execution timeouts
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Thu, 2 Jan 2014 19:58:45 +0000 (14:58 -0500)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Thu, 2 Jan 2014 21:03:19 +0000 (16:03 -0500)
The timeout deadline used to be calculated using integer instead of
long so that an overflow occurred and the actual deadline was much
shorter than intended.

Change-Id: Ia506f821f7c150ec8f96f47c50c1d683661a1dd7
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/20224
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
IP-Clean: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Hudson CI
org.eclipse.linuxtools.tmf.ui.tests/shared/org/eclipse/linuxtools/tmf/ui/tests/shared/ProjectModelTestData.java

index bbb4a2eae8dfa61a67ae1aaa79d32bbbb43976e4..6608fa310c8d478424c20ef4e6e3ee8665dbe104 100644 (file)
@@ -46,7 +46,7 @@ public class ProjectModelTestData {
     /* Maximum number of thread delays the main thread will do before timing out */
     private static final int DELAY_COUNTER = 10;
     /* Default delay time when having the main thread sleep. */
-    private static final int DEFAULT_DELAY = 500;
+    private static final long DEFAULT_DELAY = 500;
 
     /** Default test project name */
     public static final String PROJECT_NAME = "Test_Project";
@@ -210,7 +210,7 @@ public class ProjectModelTestData {
     public static void delayUntilTraceOpened(final ITmfProjectModelElement projectElement) throws TimeoutException {
         if (projectElement instanceof TmfTraceElement) {
             TmfTraceElement traceElement = (TmfTraceElement) projectElement;
-            final long deadline = System.nanoTime() + (DELAY_COUNTER * DEFAULT_DELAY * 1000000);
+            final long deadline = System.nanoTime() + (DELAY_COUNTER * DEFAULT_DELAY * 1000000L);
             do {
                 delayThread(DEFAULT_DELAY);
                 if (traceElement.getTrace() != null) {
This page took 0.034412 seconds and 5 git commands to generate.