Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343745

Summary: JUnit tests can be delayed 2 seconds unnecessarily
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 7.0Flags: marc.khouzam: review? (john.cortell)
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Fix cdtdoug: iplog-

Description Marc Khouzam CLA 2011-04-25 12:01:10 EDT
Created attachment 193997 [details]
Fix

I noticed that there is a race condition when receiving the suspended event when we start a JUnit tests.  In some tests, we perform some steps such as turning on reverse debugging, after the target is suspended.

In those cases, we would wait 2 seconds for the suspended event to arrive, although that event has already been received.

This patch simply checks if we have already received the event and avoid waiting for it in that case.
Comment 1 Marc Khouzam CLA 2011-04-25 12:03:08 EDT
Committed to HEAD.

John, can you review?
Comment 2 CDT Genie CLA 2011-04-25 12:23:12 EDT
*** cdt cvs genie on behalf of mkhouzam ***
Bug 343745: JUnit tests can be delayed 2 seconds unnecessarily

[*] BaseTestCase.java 1.16 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java?root=Tools_Project&r1=1.15&r2=1.16