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

Bug 268420

Summary: Support running headless JUnit tests on Mac OSX
Product: z_Archived Reporter: Nick Boldt <nboldt>
Component: Dash AthenaAssignee: Common Build Inbox <dash.commonbuilder-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ahti, dash.commonbuilder-inbox, elias, sven.efftinge
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 295670    
Bug Blocks:    
Attachments:
Description Flags
zip of three log files as noted in comment 0
none
build log from macosx server 10.5.7 run with Eclipse 3.5.1 cocoa 32 none

Description Nick Boldt CLA 2009-03-12 15:44:45 EDT
Created attachment 128615 [details]
zip of three log files as noted in comment 0

GEF tests on Mac (macosx.cocoa_consolelog.txt) currently fail (org.eclipse.gef.test.GEFTestSuite_macosx.carbon.metadata.log.txt) as follows:

!ENTRY org.eclipse.ui 4 0 2009-03-12 07:46:44.137
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:3860)

Then, the Draw2D tests freeze completely and 70 mins later, I killed the process (kill -9 $pid) so the build could continue (buildlog.latest.macosx.tests-get-stuck.txt).

Full logs attached. 

---

On Windows, the problem is that runtests.sh won't run, and needs to be ported to runtests.bat or runtests.cmd.

---

Even better we should translate the work done in runtests.sh to Ant so it can be merged into test.xml (in common.releng/builder/tests/). In that case, these shell scripts (as called by PDE) need only be `ant -f test.xml`.
Comment 1 Nick Boldt CLA 2009-11-26 20:35:56 EST

*** This bug has been marked as a duplicate of bug 295670 ***
Comment 2 Nick Boldt CLA 2009-11-27 00:05:40 EST
In trying to run GEF tests on Mac OSX Server 10.5, I get errors like these if I run from within Eclipse 3.5.1 Carbon32:

==> org.eclipse.draw2d.test.Draw2dTestSuite_macosx.carbon.metadata.log.txt <==
!SESSION 2009-11-26 23:16:07.264 -----------------------------------------------
eclipse.buildId=M20090917-0800
java.version=1.5.0_16
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
Framework arguments:  -application org.eclipse.test.uitestapplication formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,/tmp/build/N200911262312/testing/target/eclipse/org.eclipse.draw2d.test.Draw2dTestSuite.xml -testPluginName org.eclipse.draw2d.test -className org.eclipse.draw2d.test.Draw2dTestSuite
Command-line arguments:  -application org.eclipse.test.uitestapplication -data /tmp/build/N200911262312/testing/target/eclipse/draw2d_folder formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,/tmp/build/N200911262312/testing/target/eclipse/org.eclipse.draw2d.test.Draw2dTestSuite.xml -testPluginName org.eclipse.draw2d.test -className org.eclipse.draw2d.test.Draw2dTestSuite -os macosx -ws carbon -arch x86 -consolelog

!ENTRY org.eclipse.ui 4 0 2009-11-26 23:17:43.404
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:3884)
	at org.eclipse.swt.SWT.error(SWT.java:3799)
	at org.eclipse.swt.SWT.error(SWT.java:3770)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:696)
	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:270)
	at org.eclipse.swt.widgets.Shell.<init>(Shell.java:365)
	at org.eclipse.jface.window.Window.createShell(Window.java:487)
	at org.eclipse.jface.window.Window.create(Window.java:430)
	at org.eclipse.ui.internal.Workbench$20.runWithException(Workbench.java:1032)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3342)
	at org.eclipse.swt.widgets.Display.observerProc(Display.java:2962)

==> org.eclipse.gef.test.GEFTestSuite_macosx.carbon.metadata.log.txt <==
Invalid memory access of location 00000001 eip=9683adee

I also get this in the log:

       [build] ui-test:
       [build] java-test:
       [build]      [echo] Running org.eclipse.gef.test.GEFTestSuite. Result file: /tmp/build/N200911262345/testing/target/eclipse/results/org.eclipse.gef.test.GEFTestSuite.xml.

       [build]      [java] java(8544,0xb0801000) malloc: *** error for object 0x20c02040: incorrect checksum for freed object - object was probably modified after being freed.
       [build]      [java] *** set a breakpoint in malloc_error_break to debug
       [build]      [java] Java Result: 139

...

       [build] ui-test:
       [build] java-test:
       [build]      [echo] Running org.eclipse.draw2d.test.Draw2dTestSuite. Result file: /tmp/build/N200911262345/testing/target/eclipse/results/org.eclipse.draw2d.test.Draw2dTestSuite.xml.
       [build]      [java] Java Result: 255

If I run from within Eclipse 3.5.1 Cocoa 32, the tests simply halt and must be kill'd.

The further wierdness is that if I run from 3.5.1 Carbon 32, I get this:

${osgi.ws}=carbon

But if I run from 3.5.1 Cocoa 32, I get this:

osgi.ws=carbon

Which to me says I need to explicitly pass through the -ws, -os, -arch flags when starting up the initial basebuilder eclipse thread.
Comment 3 Nick Boldt CLA 2009-11-27 12:16:30 EST
Created attachment 153263 [details]
build log from macosx server 10.5.7 run with Eclipse 3.5.1 cocoa 32

       [build]      [java] 2009-11-27 00:42:21.948 java[9187:1003] *** _NSAutoreleaseNoPool(): Object 0x10bb20 of class NSCFString autoreleased with no pool in place - just leaking
       [build]      [java] Stack: (0x956a0f0f 0x955ad442 0x19426b79 0x39e5d6e)
       [build]      [java] 2009-11-27 00:42:21.964 java[9187:1003] *** _NSAutoreleaseNoPool(): Object 0x1123a0 of class NSCFNumber autoreleased with no pool in place - just leaking
 
  (etc.)
Comment 4 Nick Boldt CLA 2010-11-09 23:08:54 EST
This won't get done. 

If you want a simple build of Eclipse products, features, plugins, or update sites / p2 repos, using CVS, SVN, Git, or any other Hudson-supported VCS/DVCS...

I recommend using Tycho, which supports it natively.

https://docs.sonatype.org/display/TYCHO/How+to+run+SWTBot+tests+with+Tycho
http://anonsvn.jboss.org/repos/jbosstools/trunk/build/parent/pom.xml
http://www.delicious.com/nickboldt/tycho
https://docs.sonatype.org/display/TYCHO/Tycho+reference+card

Tycho also supports headless testing - though it's constrained by the OS such that OSX may force UI thread tests into the foreground while running.