Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 152468 - Cannot run Test immediately after starting up secured AC
Summary: Cannot run Test immediately after starting up secured AC
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Bing Xu CLA
QA Contact:
URL:
Whiteboard: housecleaned460 closed460
Keywords:
: 100937 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-01 11:30 EDT by Liz Dancy CLA
Modified: 2016-05-05 11:02 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liz Dancy CLA 2006-08-01 11:30:16 EDT
Steps to reproduce:

1. Run setconfig.bat for AC (version 4.2.0.1).
2. Change the security enabled option to "true" by typing "true" when prompted
3. Accept all other defaults (including allowing "ANY" users)
4. Start the AC on the localhost
5. Start an Eclipse workbench
6. Create a plugin project or import one
7. Create a new TPTP automated test case for this plugin
8. Record a simple test case and add its invocation under the 'Behaviour' Tab
9. Select the automated test and select Run As > Test (or create a new launch configuration for it and Run)
10. Enter a valid localhost userid and password when prompted.
11. An org.eclipse.core.runtime.CoreException is thrown during the launch with the following output in the Command Prompt running the AC:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:58)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java(Compiled Code))
        at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.executeCommand(FileClientHandlerExtendedImpl.java:157)
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.run(FileClientHandlerExtendedImpl.java:289)
        at java.lang.Thread.run(Thread.java:570)
Caused by: java.io.IOException: Socket closed
        at com.ibm.sslite.t.a(t.java(Compiled Code))
        at com.ibm.sslite.b.write(b.java(Compiled Code))
        at com.ibm.jsse.b.write(Unknown Source)
        at java.io.FilterOutputStream.write(FilterOutputStream.java(Compiled Cod
e))
        at java.io.FilterOutputStream.write(FilterOutputStream.java(Compiled Cod
e))
        at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.jav
a:283)
        at org.eclipse.hyades.internal.execution.core.file.socket.SocketChannel.
write(SocketChannel.java:180)
        at org.eclipse.hyades.internal.execution.core.file.communicator.ChannelC
ommunicator.send(ChannelCommunicator.java:296)
        at org.eclipse.hyades.internal.execution.core.file.communicator.ChannelC
ommunicator.receive(ChannelCommunicator.java:91)
        at org.eclipse.hyades.internal.execution.core.file.dynamic.PutFileComman
d$Server.execute(PutFileCommand.java:184)
        at org.eclipse.hyades.internal.execution.core.file.dynamic.AbstractFileS
erverCommand.execute(AbstractFileServerCommand.java:318)
        

Note: This will also occur if you create and run a TPTP JUnit test case but it does not happen when running a manual test case.
Comment 1 Liz Dancy CLA 2006-08-02 08:51:43 EDT
Note that this has been re-tested with AC 4.2.1 and TPTP 4.2.1 which both produce this error during TPTP AGR and JUnit execution as well as when running a TPTP manual test.
Comment 2 Liz Dancy CLA 2006-08-08 12:36:27 EDT
Changed severity to critical because later testing revealed more errors (see previous comment) and the work around is to turn off security which would not be suitable when security is depended upon.
Comment 3 Paul Slauenwhite CLA 2006-08-09 09:01:57 EDT
This defect is caused by the client execution code (org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl) since the socket is prematurely closed when executing a test with security enabled. 

Please assign to the Platform.Execution component.
Comment 4 Liz Dancy CLA 2006-08-09 09:20:55 EDT
I have changed the component. Scott, could you please reassign this to Guru Nagarajan.
Comment 5 Samson Wai CLA 2006-08-10 13:32:11 EDT
Liz, I cannot reproduce the problem. I can run JUnit test case successfully. Can you tell me what JDKs are you using on the Eclipse side and the RAC side?
Comment 6 Liz Dancy CLA 2006-08-10 13:45:16 EDT
I am using IBM 1.4.2 on both. Also, some other test cases resulted in failures and had this bug listed as the cause. They were in the Platform.Execution.ManualRunner.Windows_IA32 [manual]
test suite and I am not sure who ran them but I will see if I can find out so you can reproduce the manual case as well.
Comment 7 amehrega CLA 2006-08-10 15:26:34 EDT
I can reproduce the 54% hang with a JUnit test suite.  Here are the steps to reproduce it:


1) Quit the workbench
2) Start the workbench again
3) Wait until the workbench comes up and start AC on command line with security on.

Here's the stack trace that I got:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.eclipse.hyades.internal.execution.core.file.dynamic.FileServerCom
mandFactory.createFileServerCommand(FileServerCommandFactory.java:430)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.executeCommand(FileClientHandlerExtendedImpl.java:142)
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.run(FileClientHandlerExtendedImpl.java:289)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
        at org.eclipse.hyades.execution.core.loader.ScopedChannelClassLoader$Con
sumer$ContextClassLoader.loadClass(ScopedChannelClassLoader.java:334)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at org.eclipse.hyades.internal.execution.core.file.dynamic.DetermineServ
erReachCommand.<init>(DetermineServerReachCommand.java:218)
        ... 12 more
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.executeCommand(FileClientHandlerExtendedImpl.java:142)
        at org.eclipse.hyades.internal.collection.framework.FileClientHandlerExt
endedImpl.run(FileClientHandlerExtendedImpl.java:289)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.hyades.internal.execution.core.file.dynamic.InvalidFileSe
rverCommandException
        at org.eclipse.hyades.internal.execution.core.file.dynamic.FileServerCom
mandFactory.createFileServerCommand(FileServerCommandFactory.java:466)
        ... 7 more



I can successfully run this test when I start AC in secure mode BEFORE I start the workbench.
Comment 8 amehrega CLA 2006-08-10 16:06:14 EDT
If you allow sufficient time between when the AC is started and the test suite is launched, then it will work.
I believe the problem is that we don't give enough time for the AC to initialize before a test suite is launched.  Maybe the AC can block any incoming requests until it has fully initialized or output a message that it has successfully started (we don't do that on windows).
Comment 9 Samson Wai CLA 2006-08-11 08:56:30 EDT
So it ends up to be a startup timing issue. Do you agree that this can be looked at in 4.3 and a readme added to 4.2.1 instead?
Comment 10 Samson Wai CLA 2006-08-14 12:02:43 EDT
Forgot to copy Ali. Do you agree this can be documented in 4.2.1 and revisited in 4.3?
Comment 11 Samson Wai CLA 2006-08-14 12:24:57 EDT
The Agent Controller server port (10002) is a native port while the secured and file server ports (10003 and 10005) are Java ports. Port 10002 comes up quickest (since it is native code) and will start receiving incomming connection requests. The Java ports (10003 and 10005) will take a while to come up because it takes some time for the native code to create JVMs and load up the security and file service classes. If the Agent Controller is secured, any incomming connection will be rejected when trying to connect to 10002 and the client will be asked to reconnect to port 10003. Secured connection will fail if the time for the AC to create port 10003 is longer than the time for the client to connect to 10003. This will only happen if the AC is first started and then the workbench immediately trying to connect. This will not happen if the AC is already running (standalone or as a service).

The workaround is to check if those ports are available before trying to use the Agent Controller. The command to use on Windows is:

"netstat -a -p tcp"

The output should look like:

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    neko:10002             neko:0                 LISTENING
  TCP    neko:10003             neko:0                 LISTENING
  TCP    neko:10005             neko:0                 LISTENING
  TCP    neko:10006             neko:0                 LISTENING

Make sure port 10003 and 10005 are listening before connecting to the AC.
Comment 12 amehrega CLA 2006-08-14 13:18:45 EDT
I think one of the bad side effects of launching a test suite before the AC is fully functional is that subsequent launches will all hang at 54%.
Comment 13 amehrega CLA 2006-08-14 13:25:12 EDT
Liz is the reporter but my personal opinion is that it can be documented and re-visited in 4.3 timeframe.
Comment 14 Liz Dancy CLA 2006-08-14 13:45:52 EDT
I agree that as long as it is documented it can be pushed to 4.3.
Comment 15 Paul Slauenwhite CLA 2006-08-14 14:58:44 EDT
Please assign to Samson.
Comment 16 Liz Dancy CLA 2006-08-14 15:05:35 EDT
Changed component to "Platform.Communication". Karla, could you please re-assign this to Samson as I am not able to?
Comment 17 Samson Wai CLA 2006-08-15 10:17:35 EDT
Doc bug 153910 has been opened.
Comment 18 Samson Wai CLA 2006-08-17 12:10:06 EDT
Transferred to 4.3 and a doc bug is opened for 4.2.1
Comment 19 Samson Wai CLA 2006-09-11 11:54:38 EDT
Set to 4.3 w/o iteration for bug triaging.
Comment 20 Samson Wai CLA 2006-09-20 12:11:14 EDT
Changing the summary.
Comment 21 Samson Wai CLA 2006-10-30 10:27:10 EST
Not containable in 4.3 and retarget to 4.4. Please let me know if you have any concern.
Comment 22 Samson Wai CLA 2007-01-31 11:31:17 EST
Not containable in 4.4.
Comment 23 Paul Slauenwhite CLA 2007-04-30 12:27:59 EDT
*** Bug 100937 has been marked as a duplicate of this bug. ***
Comment 24 Samson Wai CLA 2007-11-27 09:33:44 EST
Hi Bing. I have transferred my bugs to you for triage. Thanks.
Comment 25 Paul Slauenwhite CLA 2009-06-30 06:57:59 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. Since this defect is more than 2 years old, it may be no longer relevant. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this defect is resolved as WONTFIX. If this defect is still relevant and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 26 Paul Slauenwhite CLA 2009-06-30 10:31:34 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.