Bug 347286

Summary: [server] problem with junit server tests
Product: [ECD] Orion (Archived) Reporter: Piotr Janik <janikpiotrek>
Component: ClientAssignee: John Arthorne <john.arthorne>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, Szymon.Brandys, tomasz.zarna
Version: 0.2Keywords: test
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Piotr Janik CLA 2011-05-26 06:52:30 EDT
Recently I can't run junit server test (i.e. using launch configuration All Server Tests). At the beginning, there is an exception:
java.io.FileNotFoundException: C:\Users\piotr\junit-workspace (Access is denied)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.eclipse.orion.server.configurator.configuration.OrionPreferenceInitializer.readProperties(OrionPreferenceInitializer.java:79)
	at org.eclipse.orion.server.configurator.configuration.OrionPreferenceInitializer.initializeDefaultPreferences(OrionPreferenceInitializer.java:61)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:281)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:284)	
(...)
and later all the tests fail, because of http 404 returned each time. New directory for junit-workspace, another jvm, clearing all the projects etc. - nothing helped. 
A few days ago, I reverted my workspace to some earlier version (about 19/05) and exception was still thrown, but even so all the server tests passed. 
When I start Orion using web-ide.launch, everything seems to be ok. No exceptions and I can work without problems.
Comment 1 Tomasz Zarna CLA 2011-05-26 07:00:51 EDT
I'm dealing with the same problem here. I'm able to launch the tests once in a while when I'm in debug mode.

(In reply to comment #0)
> A few days ago, I reverted my workspace to some earlier version (about 19/05)
> and exception was still thrown, but even so all the server tests passed.

Are you able to identify the commit that made the difference?
Comment 2 Piotr Janik CLA 2011-05-26 07:25:04 EDT
Well, I've tried and it seems for me, that commit which made the difference is:
[client] Search is broken.
commit 4a45151a248911b0a229b0dde2f30feaf0e45a95
Author: skaegi <simon_kaegi@ca.ibm.com> 2011-05-20 17:41:21

When this version is checked out, the exception is thrown and tests fail. When I check out its parent commit:

Misc doc updates
commit 93397418d39077f9888780f569e7ecf05a4a36fa
Author: John Arthorne <John_Arthorne@ca.ibm.com> 2011-05-19 21:37:23

the exception is thrown, but tests pass.
Comment 3 Tomasz Zarna CLA 2011-05-26 11:12:02 EDT
Have you tried reverting 4a45151a248911b0a229b0dde2f30feaf0e45a95?
Comment 4 John Arthorne CLA 2011-05-26 11:23:52 EDT
I can see the problem. Fix coming... Part of the solution is that we need to specify this system property to avoid jetty from auto-starting (since we start it manually):

-Dorg.eclipse.equinox.http.jetty.autostart=false
Comment 5 John Arthorne CLA 2011-05-26 11:36:45 EDT
Released a fix. Pull the server git repo to get the changes. You also have to make sure this system property is set:

-Dorg.eclipse.equinox.http.jetty.autostart=false

It was really luck that this worked before. Jetty starts a default server if you don't specify this property, and that default server was actually handling all requests when running the tests. The Jetty server started by Orion and by the Orion tests bundle were not being used.
Comment 6 Tomasz Zarna CLA 2011-05-27 06:39:13 EDT
Verified on HEAD.