Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2011-04-25 12:02:27 -0400
committerMarc Khouzam2011-04-25 12:02:27 -0400
commitbe1c53102bd9c809c4602a02b8978257ce6b6061 (patch)
treef4c81c872ffcc3909004173dfb99d7f4d6bb0023
parenta942a027083c0bc5261e76fbf63c37d9257e1cc5 (diff)
downloadorg.eclipse.cdt-be1c53102bd9c809c4602a02b8978257ce6b6061.tar.gz
org.eclipse.cdt-be1c53102bd9c809c4602a02b8978257ce6b6061.tar.xz
org.eclipse.cdt-be1c53102bd9c809c4602a02b8978257ce6b6061.zip
Bug 343745: JUnit tests can be delayed 2 seconds unnecessarily
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
index 962bfcf381..381d5d4a2c 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
@@ -177,13 +177,16 @@ public class BaseTestCase {
fLaunch = (GdbLaunch)lc.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor());
DsfSession.removeSessionStartedListener(sessionStartedListener);
- // Wait for the program to hit the breakpoint at main() before
+ // If we haven't hit main() yet,
+ // wait for the program to hit the breakpoint at main() before
// proceeding. All tests assume that stable initial state. Two
// seconds is plenty; we typically get to that state in a few
// hundred milliseconds with the tiny test programs we use.
- synchronized (fTargetSuspendedSem) {
- fTargetSuspendedSem.wait(TestsPlugin.massageTimeout(2000));
- Assert.assertTrue(fTargetSuspended);
+ if (!fTargetSuspended) {
+ synchronized (fTargetSuspendedSem) {
+ fTargetSuspendedSem.wait(TestsPlugin.massageTimeout(2000));
+ Assert.assertTrue(fTargetSuspended);
+ }
}
// This should be a given if the above check passes

Back to the top