1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 343745: JUnit tests can be delayed 2 seconds unnecessarily

This commit is contained in:
Marc Khouzam 2011-04-25 16:02:27 +00:00
parent a942a02708
commit be1c53102b

View file

@ -177,14 +177,17 @@ public class BaseTestCase {
fLaunch = (GdbLaunch)lc.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor()); fLaunch = (GdbLaunch)lc.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor());
DsfSession.removeSessionStartedListener(sessionStartedListener); 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 // proceeding. All tests assume that stable initial state. Two
// seconds is plenty; we typically get to that state in a few // seconds is plenty; we typically get to that state in a few
// hundred milliseconds with the tiny test programs we use. // hundred milliseconds with the tiny test programs we use.
if (!fTargetSuspended) {
synchronized (fTargetSuspendedSem) { synchronized (fTargetSuspendedSem) {
fTargetSuspendedSem.wait(TestsPlugin.massageTimeout(2000)); fTargetSuspendedSem.wait(TestsPlugin.massageTimeout(2000));
Assert.assertTrue(fTargetSuspended); Assert.assertTrue(fTargetSuspended);
} }
}
// This should be a given if the above check passes // This should be a given if the above check passes
synchronized(this) { synchronized(this) {