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

Bug 208616

Summary: Can't launch junit plug-in test with remote deployment
Product: z_Archived Reporter: Kendric Wang <kendricw>
Component: TPTPAssignee: Jerome Gout <jerome.gout>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: jcayne, jerome.bozier, paulslau
Version: unspecifiedKeywords: plan
Target Milestone: ---Flags: paulslau: review+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
exception stack trace
none
patch. see description bellow
none
Patched plug-in (HEAD)
none
Zipped patched plug-in (HEAD)
none
nullpointerexception
none
Patched JAR (HEAD)
none
patch for deployment on remote machine none

Description Kendric Wang CLA 2007-11-02 16:13:44 EDT
Build ID: I20071031-0010

Setup:
- 4.5 candidate driver (TPTP-4.5.0-200710260400)
- IBM JRE50 (J9)

Steps To Reproduce:
1. create junit plug-in test
2. create an artifact
3. create a workbench location
     - specify remote host
     - specify eclipse location
4. create a deployment
     - create a artifact + remote location pair
5. startup ACServer on remote machine
6. run junit plug-in testsuite with remote deployment


An error is produced. Output from the eclipse error log:

!ENTRY org.eclipse.hyades.test.core 1 0 2007-11-02 14:39:18.442
!MESSAGE org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
!STACK 0
org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
	at org.eclipse.hyades.execution.harness.TestExecutionHarnessExecutorStub.launch(TestExecutionHarnessExecutorStub.java:422)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness.launchTestExecution(TestExecutionHarness.java:2098)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness.access$2(TestExecutionHarness.java:1830)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness$2.run(TestExecutionHarness.java:750)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.hyades.test.core 1 0 2007-11-02 14:39:18.452
!MESSAGE java.lang.RuntimeException: org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
!STACK 0
java.lang.RuntimeException: org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
	at org.eclipse.hyades.execution.harness.TestExecutionHarnessExecutorStub.handleException(TestExecutionHarnessExecutorStub.java:347)
	at org.eclipse.hyades.execution.harness.TestExecutionHarnessExecutorStub.launch(TestExecutionHarnessExecutorStub.java:434)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness.launchTestExecution(TestExecutionHarness.java:2098)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness.access$2(TestExecutionHarness.java:1830)
	at org.eclipse.hyades.execution.harness.TestExecutionHarness$2.run(TestExecutionHarness.java:750)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
	at org.eclipse.hyades.execution.harness.TestExecutionHarnessExecutorStub.launch(TestExecutionHarnessExecutorStub.java:422)
	... 4 more

!ENTRY org.eclipse.hyades.test.core 4 0 2007-11-02 14:39:18.462
!MESSAGE IWAT4039E The Test Execution Harness reported the following problems:org.eclipse.hyades.internal.execution.local.control.InactiveProcessException
Comment 1 Kendric Wang CLA 2007-11-02 16:15:18 EDT
Both the Symantec and Windows firewall were disabled on the remote machine.
Comment 2 Paul Slauenwhite CLA 2007-11-07 09:47:19 EST
This defect is only reproducible when:

1) Using a workbench location.
2) Modifying the Eclipse location path to another Eclipse instance.

Jerome, this is critical defect.  Can you triage and determine if you can provide a fix this week so we can include it in i3?
Comment 3 Paul Slauenwhite CLA 2007-11-19 10:52:28 EST
Kendric, what percentage does this hang?
Comment 4 Kendric Wang CLA 2007-11-19 16:25:52 EST
Created attachment 83281 [details]
exception stack trace

As it turns out, I tried to reproduce the problem with the above steps, but it doesn't hang anymore. I ran the scenario using 2 window machines (then alternating the local and remote machines) and also tried both windows with a linux machine. In all cases, I now get a NullPointerException error instead. After running the remote test deployment, and then waiting about a minute, an error dialog will pop up saying:

"IWAT4039E The Test Execution Harness reported the following problems:java.lang.NullPointerException"

See the attached error log for more information.
Comment 5 Paul Slauenwhite CLA 2007-11-20 09:41:35 EST
(In reply to comment #4)
> Created an attachment (id=83281) [details]
> exception stack trace
> 
> As it turns out, I tried to reproduce the problem with the above steps, but it
> doesn't hang anymore. I ran the scenario using 2 window machines (then
> alternating the local and remote machines) and also tried both windows with a
> linux machine. In all cases, I now get a NullPointerException error instead.
> After running the remote test deployment, and then waiting about a minute, an
> error dialog will pop up saying:
> 
> "IWAT4039E The Test Execution Harness reported the following
> problems:java.lang.NullPointerException"
> 
> See the attached error log for more information.
> 

This is the same symptom as https://bugs.eclipse.org/bugs/show_bug.cgi?id=192935, which was fixed in 4.4.1.  I verified the code is correctly integrated into the 441 and HEAD (4.5) streams.

Kendric: Are you using the the 4.5 I3 TP2 candidate driver (http://www.eclipse.org/tptp/home/downloads/?buildId=TPTP-4.5.0-200711050917).
Comment 6 Paul Slauenwhite CLA 2007-11-21 13:55:32 EST
(In reply to comment #5)

I confirmed Kendric is using the 4.5 driver.  
Comment 7 Kendric Wang CLA 2007-11-22 15:27:22 EST
Tested remote deployment configurations with org.eclipse.tptp.test.tools.junit.plugin_4.4.100.209263_PATCH.jar.

Got the same NullPointerException error. This time around, there wasn't a pop-up dialog to indicate the NPE. Instead, the progress meter hung at 33% and the only message about a NPE was in the Error Log.
Comment 8 Bozier jerome CLA 2007-11-23 04:00:35 EST
Created attachment 83609 [details]
patch. see description bellow

To make remote execution, the local "platform.xml" file is parsed and all occurence of local eclipse dir have to be replaced by remote eclipse dir.

Before the patch, it was only looking for local eclipse dir written like this :
"d:\\eclipse_install\eclipse". 
Now, it also replace local eclipse dir written like this :
"d:/eclipse_install/eclipse"
Comment 9 Paul Slauenwhite CLA 2007-11-23 06:47:34 EST
Created attachment 83621 [details]
Patched plug-in (HEAD)
Comment 10 Paul Slauenwhite CLA 2007-11-23 06:49:01 EST
(In reply to comment #9)
> Created an attachment (id=83621) [details]
> Patched plug-in (HEAD)
> 

Kendric, can you verify this patch?
Comment 11 Paul Slauenwhite CLA 2007-11-23 07:04:58 EST
Comment on attachment 83621 [details]
Patched plug-in (HEAD)

The patched plug-in cannot be JARed.
Comment 12 Paul Slauenwhite CLA 2007-11-23 07:05:32 EST
Created attachment 83622 [details]
Zipped patched plug-in (HEAD)
Comment 13 Paul Slauenwhite CLA 2007-11-23 07:09:08 EST
(In reply to comment #12)
> Created an attachment (id=83622) [details]
> Zipped patched plug-in (HEAD)
> 

Tested using the TPTP-4.5.0-200711050917 driver with the following results:

-Both path separators (\ and /) work in the Eclipse Location field of the workbench location.

-Changing the path in the Eclipse Location field of the workbench location to another Eclipse instance (same build) caused an org.eclipse.hyades.internal.execution.local.control.InactiveProcessException.  Both path separators (\ and /) were tried.
Comment 14 Paul Slauenwhite CLA 2007-11-23 07:20:50 EST
Note, the local and target (e.g. remote) workbench MUST be the same build, since the plug-in IDs contain the build ID.
Comment 15 Paul Slauenwhite CLA 2007-11-23 08:56:30 EST
(In reply to comment #13)
> (In reply to comment #12)
> > Created an attachment (id=83622) [details] [details]
> > Zipped patched plug-in (HEAD)
> > 
> 
> Tested using the TPTP-4.5.0-200711050917 driver with the following results:
> 
> -Both path separators (\ and /) work in the Eclipse Location field of the
> workbench location.
> 
> -Changing the path in the Eclipse Location field of the workbench location to
> another Eclipse instance (same build) caused an
> org.eclipse.hyades.internal.execution.local.control.InactiveProcessException. 
> Both path separators (\ and /) were tried.
> 

After confirming, the local workbench was the 4.5 I3 TP2 driver and the target workbench was the 4.5 I3 TP1 driver.  After making both of the workbenches the same version (different directories), both path separators (\ and /) cause the same symptom.  The target workbench appears, runs the test, and closes, but the test continues to execute (capping at the standard 93% progress).

Kendric: Can you confirm this behavior?

Jorome: Please open two defects to resolve the following:

1) More meaningful error messages when JUnit plug-in test execution fails.

2) Eliminate the version sensitivity when launching JUnit plug-in tests.

Comment 16 Kendric Wang CLA 2007-11-23 08:59:56 EST
Created attachment 83635 [details]
nullpointerexception

Replaced the test tool plugin with the new patch on both remote and local sides. Both eclipse installations are using the same build id. 

Still getting the following NPE. See attachment.
Comment 17 Paul Slauenwhite CLA 2007-11-23 09:10:38 EST
Comment on attachment 83622 [details]
Zipped patched plug-in (HEAD)

Wrong patch.
Comment 18 Paul Slauenwhite CLA 2007-11-23 09:14:08 EST
Created attachment 83639 [details]
Patched JAR (HEAD)

Copy this JAR to <Eclipse install direcotry>\eclipse\plugins\org.eclipse.tptp.test.tools.junit.plugin_4.4.100.v200709070956 (4.5 I4 TP2 candidate driver)
Comment 19 Joel Cayne CLA 2007-11-23 10:42:24 EST
I tested the jar file with the latest patch and continue to get a Null Pointer Exception.

1. Downloaded All-In-One TPTP-4.5.0-200711210400 and Agent Controller for Win_IA32.
2. Extracted latest jar patch and replaced contents of eclipse\plugins\org.eclipse.tptp.test.tools.junit.plugin_4.4.100.v200709070956 folder with the contents of the jar file (copied and pasted only the matching files and left out the source).
3. Copied the same files to the plugins folder of the Agent Controller on the remote machine
4. Copied the eclipse directory to my remote machine
5. Created a plug-in project
6. Created a TPTP junit plug-in test
7. Created a deployment with a new location (remote) and artifact
8. Updated the location with a workspace location (local to the remote machine)
9. Run the test against the deployment
10. Null Pointer Exception thrown

!ENTRY org.eclipse.tptp.test.tools.junit.plugin 1 0 2007-11-23 09:01:20.359
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.getBrandingPlugin(WorkbenchExecutionDeploymentAdapter.java:506)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.makeConfigurationArea(WorkbenchExecutionDeploymentAdapter.java:337)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.makeConfigurationAreas(WorkbenchExecutionDeploymentAdapter.java:309)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.collectDeployableFiles(WorkbenchExecutionDeploymentAdapter.java:109)
		 at org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter.deployTestAssets(JavaExecutionDeploymentAdapter.java:462)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter.deployTestAssets(WorkbenchExecutionDeploymentAdapter.java:103)
		 at org.eclipse.hyades.execution.harness.util.ExecutionAdapterUtilities.adaptExecutionDeployment(ExecutionAdapterUtilities.java:158)
		 at org.eclipse.hyades.execution.harness.TestExecutionHarness.launchTestExecution(TestExecutionHarness.java:1985)
		 at org.eclipse.hyades.execution.harness.TestExecutionHarness.access$2(TestExecutionHarness.java:1830)
		 at org.eclipse.hyades.execution.harness.TestExecutionHarness$2.run(TestExecutionHarness.java:750)
		 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.eclipse.hyades.test.core 1 0 2007-11-23 09:01:24.171
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
		 at org.eclipse.core.runtime.Path.<init>(Path.java:152)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutableObjectAdapter.computeCommandLine(WorkbenchExecutableObjectAdapter.java:113)
		 at org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutableObjectAdapter.setupExecutableObject(WorkbenchExecutableObjectAdapter.java:57)
		 at org.eclipse.hyades.execution.harness.util.ExecutionAdapterUtilities.adaptExecutableObject(ExecutionAdapterUtilities.java:90)		 at org.eclipse.hyades.execution.harness.TestExecutionHarness.launchTestExecution(TestExecutionHarness.java:2021)
		 at org.eclipse.hyades.execution.harness.TestExecutionHarness.access$2(TestExecutionHarness.java:1830)
		 at org.eclipse.hyades.execution.harness.TestExecutionHarness$2.run(TestExecutionHarness.java:750)
		 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.eclipse.hyades.test.core 4 0 2007-11-23 09:01:24.234
!MESSAGE IWAT4039E The Test Execution Harness reported the following problems:java.lang.NullPointerException
Comment 20 Kendric Wang CLA 2007-11-23 12:14:01 EST
(In reply to comment #15)

Yep. I see the exact behaviour as described by Paul.

Steps taken:
1. Replaced 'junit.plugin.jar' in org.eclipse.tptp.test.tools.junit.plugin with the corresponding patch for the AC and eclipse installation on both the local and remote machines.
2. Ran the steps to create a remote deployment. (See description)
Comment 21 Joel Cayne CLA 2007-11-23 14:10:06 EST
I have determined why I was getting a Null Pointer Exception. Converting a Location to a Workbench Location results in the Null Pointer Exception. However, it still hangs during execution and does not complete running the tests.
Comment 22 Bozier jerome CLA 2007-11-27 12:22:24 EST
Created attachment 83885 [details]
patch for deployment on remote machine

this patch contains all the fixes :
. fix replacement of local path to remote one on platform.xml file
. fix deployment directory for bundles
. change command separator to be less dependant of jvm language beetwen local and remote machine
Comment 23 Kendric Wang CLA 2007-11-28 12:31:41 EST
Confirmed that this patch fixes the earlier remote deployment issues using the TPTP-4.5.0-200711050917 driver. 

- Able to launch remote workbench by specifying the remote eclipse location with either path separators (\ or /)
- Execution result file gets generated in the local workspace

Note: After the remote workbench gets launched, it does wait around a couple of minutes. I'm not sure why it does this because the Junit tests were straightforward assert(true) or assert(false) statements.
Comment 24 Paul Slauenwhite CLA 2007-11-28 14:37:08 EST
Comment on attachment 83609 [details]
patch. see description bellow

This patched has been superseded.
Comment 25 Paul Slauenwhite CLA 2007-11-28 14:38:17 EST
Comment on attachment 83639 [details]
Patched JAR (HEAD)

Now obsolete.
Comment 26 Paul Slauenwhite CLA 2007-11-28 14:46:58 EST
Reviewed and checked in to CVS (HEAD).

Jerome, please add the hours worked to the defect.  
Comment 27 Paul Slauenwhite CLA 2007-11-29 06:25:39 EST
Jerome Bozier worked 48 hours to complete this defect.  Thanks Jerome.
Comment 28 Joel Cayne CLA 2008-07-31 16:40:43 EDT
Closing.