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

Bug 370329

Summary: GetContentUsingRemoteHelp randomly fails on JRE 7 due to wrong test order
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: User AssistanceAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold, daniel_megert, kim.moir
Version: 3.8   
Target Milestone: 3.8 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix without noise none

Description Dani Megert CLA 2012-02-01 09:39:05 EST
N20120131-2000.

GetContentUsingRemoteHelp randomly fails on JRE 7 due to wrong test order.


The reason seems to be the remote ordering tests which start a second test server. If that happens before the testContentFound test, then the port is wrong.

Attached is a patch that ensures a fixed order for the tests.

However, I think it would be better to correctly start and stop the servers on startUp() and tearDown(). I tried to add
		TestServerManager.stop("ua.test", 0);
		TestServerManager.stop("ua.test2", 1);
but this didn't work.


Chris, can you shed some lights on how those test servers are started/stopped and why the port is wrong when the ordering is not OK?
Comment 1 Dani Megert CLA 2012-02-01 09:40:50 EST
Created attachment 210372 [details]
Fix
Comment 2 Kim Moir CLA 2012-02-01 10:15:22 EST
Patched released and merged into integration
Comment 3 Dani Megert CLA 2012-02-01 10:40:49 EST
(In reply to comment #2)
> Patched released and merged into integration

Thanks Kim!

Chris, I'd still be interested in learning the details of this test class.
Comment 4 Chris Goldthorpe CLA 2012-02-01 16:42:24 EST
I've taken a look at the test and don't understand why the order of tests is important. I haven't run the test in a debugger.

These tests are testing remote help by connecting to a mock server to get the content that a remote server would provide. The request to the mock server goes through MockContentServlet which returns an html page which includes the port number of the server. The port number is included in the response so that in the case where there are two mock remote servers we can verify that we are reading content from the right server. The test will start the mock servers if they are not already running but does not attempt to shut them down.

If the test fails by returning the wrong port number it suggests that the remote content in the single sever test is coming from the second server, but I don't exactly understand why since the single server test sets the preferences to only look for the first server.
Comment 5 Dani Megert CLA 2012-02-02 04:29:14 EST
Thanks for the explanation Chris. I now understand why the order is important: there is a test (setTwoMockRemoteServersReversePriority) that inverts the ports. If that one is executed before the "normal/single" server tests, then they fail due to the switched ports. Do you agree with that conclusion?
Comment 6 Chris Goldthorpe CLA 2012-02-02 12:13:47 EST
That seems like a plausible explanation, I would have to debug the test case to know for sure.
Comment 7 Dani Megert CLA 2012-02-03 01:20:29 EST
(In reply to comment #2)
> Patched released and merged into integration

Kim, did you forget to push your changes? The fix is not in the shared repository (HEAD is 8 days old):
http://git.eclipse.org/c/platform/eclipse.platform.ua.git/commit/?id=HEAD
Comment 8 Dani Megert CLA 2012-02-03 02:30:05 EST
Created attachment 210490 [details]
Fix without noise
Comment 9 Kim Moir CLA 2012-02-03 09:01:08 EST
Sorry, not sure what happened there. I've released your new patch and pushed to the remote master and integration branches.
Comment 10 Dani Megert CLA 2012-02-05 04:19:47 EST
Verified in N20120203-2000.
Comment 11 Dani Megert CLA 2012-02-05 04:22:07 EST
.