Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346789 - [tests] Remote JUnits don't work anymore
Summary: [tests] Remote JUnits don't work anymore
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-21 11:34 EDT by Marc Khouzam CLA
Modified: 2012-02-29 13:24 EST (History)
2 users (show)

See Also:


Attachments
First part of fix (19.29 KB, patch)
2011-05-21 11:37 EDT, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff
Properly detect that remote tests have stopped at main (4.37 KB, patch)
2012-02-09 15:46 EST, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2011-05-21 11:34:47 EDT
I broke the remote JUnit tests during my adding of other JUnit tests.
Comment 1 Marc Khouzam CLA 2011-05-21 11:37:39 EDT
Created attachment 196271 [details]
First part of fix

The problem was that we now clear the launch attributes before every class of tests, therefore when a suite sets an attribute, that attribute is lost as soon as the first class of test is loaded.

This patch adds a concept of globalLaunchAttributes which will not be reset when loading a new class of tests.  Those global attributes can be used by suites, but the suite must clear them once it is done.

Committed to HEAD
Comment 2 CDT Genie CLA 2011-05-21 12:23:08 EDT
*** cdt cvs genie on behalf of mkhouzam ***
Bug 346789: Remote JUnits don't work anymore

[*] Suite_Remote_7_2.java 1.6 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/tests/tests_7_2/Suite_Remote_7_2.java?root=Tools_Project&r1=1.5&r2=1.6

[*] Suite_Remote_7_1.java 1.6 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/tests/tests_7_1/Suite_Remote_7_1.java?root=Tools_Project&r1=1.5&r2=1.6

[*] Suite_Remote_7_0.java 1.8 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/tests/tests_7_0/Suite_Remote_7_0.java?root=Tools_Project&r1=1.7&r2=1.8

[*] Suite_Remote_7_3.java 1.3 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/tests/tests_7_3/Suite_Remote_7_3.java?root=Tools_Project&r1=1.2&r2=1.3

[*] Suite_Remote_6_6.java 1.6 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/tests/tests_6_6/Suite_Remote_6_6.java?root=Tools_Project&r1=1.5&r2=1.6

[*] Suite_Remote_6_8.java 1.6 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/tests/tests_6_8/Suite_Remote_6_8.java?root=Tools_Project&r1=1.5&r2=1.6

[*] BaseTestCase.java 1.17 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.16&r2=1.17
[+] BaseRemoteSuite.java  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/BaseRemoteSuite.java?root=Tools_Project&revision=1.1&view=markup

[*] Suite_Remote_6_7.java 1.6 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/tests/tests_6_7/Suite_Remote_6_7.java?root=Tools_Project&r1=1.5&r2=1.6
Comment 3 Marc Khouzam CLA 2012-02-02 06:38:57 EST
Note that there was a memory leak that prevented us from running more than 140 remote tests.  This has been fixed by Bug 370376
Comment 4 Marc Khouzam CLA 2012-02-09 15:46:49 EST
Created attachment 210823 [details]
Properly detect that remote tests have stopped at main

There is a problem with the startup sequence of the remote tests.

The tests need to know when we are properly stopped at main.

With GDB >= 7.0, when connecting to the remote gdbserver, we get a first *stopped event at connection time.  This is not the event we want.  I had modified the code to instead listen for an IBreakpointHitDMEvent.

However, with GDB <= 6.8, temporary breakpoints are not reported as breakpoint-hit, so we don't get an IBreakpointHitDMEvent for GDB <= 6.8 but simply an ISuspendedDMEvent.

So, the question was, how can we listen for an ISuspendedDMEvent, but know that for GDB >= 7.0 we should ignore the first one?

What I found to be able to know we have stopped at main, in all cases,
is to look for an ISuspendedDMEvent and then confirming that it indicates
in its frame that it stopped at "main".  This will allow us to skip
the first *stopped event for GDB >= 7.0 and also properly detect the stop for GDB <= 6.8

The attach patch does this.
2007 extra remote tests now pass :)

I will commit to master.
Comment 5 Marc Khouzam CLA 2012-02-10 05:49:02 EST
Remote tests now work overall.  Some individual failures need to be fixed, but I'll address that in a separate bug.
Comment 6 CDT Genie CLA 2012-02-29 13:24:47 EST
*** cdt git genie on behalf of Marc Khouzam ***

    Bug 346789: fix startup sequence for remote JUnits tests

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=7f07eb597c9255655efd9895093ac7fb8ac42127
Comment 7 CDT Genie CLA 2012-02-29 13:24:48 EST
*** cdt git genie on behalf of Marc Khouzam ***

    Bug 346789: fix startup sequence for remote JUnits tests

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=7f07eb597c9255655efd9895093ac7fb8ac42127
*** cdt git genie on behalf of Marc Khouzam ***

    Bug 346789: fix startup sequence for remote JUnits tests

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=7f07eb597c9255655efd9895093ac7fb8ac42127