Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2017-04-14 22:01:16 -0400
committerGerrit Code Review @ Eclipse.org2017-04-15 03:43:52 -0400
commit1670530ffbd77c42f6cc992ed08c959a21b74715 (patch)
tree193dffc523f244901b85cc4ec4742847367eff1e /dsf-gdb
parent54f2d8770f85443db323ede0f8f9720393c6bb6d (diff)
downloadorg.eclipse.cdt-1670530ffbd77c42f6cc992ed08c959a21b74715.tar.gz
org.eclipse.cdt-1670530ffbd77c42f6cc992ed08c959a21b74715.tar.xz
org.eclipse.cdt-1670530ffbd77c42f6cc992ed08c959a21b74715.zip
Bug 515307: Run test order of magnitude faster
Remove massage timeouts for places waiting for no events This is a partial revert of c19640498de038304950a388022991d227b06356 which was part of Bug 499784. Change-Id: Ib66ed5eaf45977d4ffae77358deaf1f593e005c6 Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java122
1 files changed, 31 insertions, 91 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java
index 95500f460e..8cbfbec591 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/nonstop/GDBMultiNonStopRunControlTest.java
@@ -754,13 +754,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected not to find all threads suspended, but did", result);
- // Make sure no other running event arrives
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500));
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -848,12 +842,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no threads to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other running event arrives
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -900,12 +889,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no threads to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
//////////////////////////////////////////////////////////////////////
@@ -1102,12 +1086,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected that not all threads are suspended, but they are", result);
- try {
- eventWaitor.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other stopped event arrives
- fail("Got an unexpected stopped event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitor);
}
/**
@@ -2783,12 +2762,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other running event arrives
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -2835,12 +2809,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no threads to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
//////////////////////////////////////////////////////////////////////
@@ -3132,14 +3101,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no contexts to be suspended, but found some", result);
- try {
- // TODO: This Test is failing when using TestsPlugin.massageTimeout,
- // Investigate if the failure with massageTimeout is justified
- eventWaitor.waitForEvent(500); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitor);
}
/**
@@ -3180,14 +3142,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no contexts to be suspended, but found some", result);
- try {
- // TODO: This Test is failing when using TestsPlugin.massageTimeout,
- // Investigate if the failure with massageTimeout is justified
- eventWaitor.waitForEvent(500); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitor);
}
/**
@@ -3231,12 +3186,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -3284,12 +3234,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other running event arrives
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -3337,12 +3282,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other running event arrives
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -3390,11 +3330,26 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no threads to be suspended, but found some", result);
+ assertNoEventsArrive(eventWaitorRunning);
+ }
+
+ /**
+ * Asserts that after a reasonable amount of time that no unexpected events
+ * are received.
+ */
+ private void assertNoEventsArrive(final ServiceEventWaitor<?> eventWaitor) {
try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
+ /*
+ * Don't massage this timeout, we are waiting to make sure events
+ * don't arrive. If we massage timeout we end up waiting much longer
+ * than test expected or makes any sense. See
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=515307#c5 for
+ * history as to why this timeout is not massaged.
+ */
+ eventWaitor.waitForEvent(500);
fail("Got an unexpected running event");
} catch (Exception e) {
- // Timeout expected. Success.
+ // Timeout expected. Success.
}
}
@@ -3760,12 +3715,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -3813,12 +3763,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no process to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no other running event arrives
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
/**
@@ -3866,12 +3811,7 @@ public class GDBMultiNonStopRunControlTest extends BaseParametrizedTestCase {
});
assertFalse("expected no threads to be suspended, but found some", result);
- try {
- eventWaitorRunning.waitForEvent(TestsPlugin.massageTimeout(500)); // Make sure no running events arrive
- fail("Got an unexpected running event");
- } catch (Exception e) {
- // Timeout expected. Success.
- }
+ assertNoEventsArrive(eventWaitorRunning);
}
//////////////////////////////////////////////////////////////////////

Back to the top