Bug 345127 - mac tests are failing due to os upgrade
Summary: mac tests are failing due to os upgrade
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 RC3   Edit
Assignee: Kim Moir CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2011-05-09 07:41 EDT by Kim Moir CLA
Modified: 2011-08-15 17:06 EDT (History)
5 users (show)

See Also:
markus.kell.r: review+
ob1.eclipse: review? (bokowski)
pwebster: review+
remy.suen: review+


Attachments
patch (936 bytes, patch)
2011-05-09 13:35 EDT, Kim Moir CLA
no flags Details | Diff
patch to switch to macosx cocoa x86_64 for testing (7.46 KB, patch)
2011-05-18 16:35 EDT, Kim Moir CLA
no flags Details | Diff
patch (1.82 KB, patch)
2011-05-19 11:16 EDT, Kim Moir CLA
no flags Details | Diff
Possible temporary workaround for session tests (1.76 KB, patch)
2011-05-19 15:42 EDT, Oleg Besedin CLA
no flags Details | Diff
Possible temporary workaround Update1 (1.76 KB, text/plain)
2011-05-24 11:40 EDT, Oleg Besedin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Moir CLA 2011-05-09 07:41:57 EDT
Looks like all the Mac tests fail because of this: 

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:216)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:193)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:101) 

Either use macosx-cocoa-x86_64 on this machine, or add -d32 when launching the tests.
Comment 1 Kim Moir CLA 2011-05-09 13:35:35 EDT
Created attachment 195110 [details]
patch
Comment 2 Kim Moir CLA 2011-05-09 13:37:38 EDT
Markus, please approve this change. 

I've already fixed it for the I20110509-1200 build.
Comment 3 Markus Keller CLA 2011-05-09 14:25:33 EDT
Looks good, let's hope it works ;-).
Comment 4 Kim Moir CLA 2011-05-09 14:28:55 EDT
Yes, I tested it this morning and it seemed to fix the problem :-)
Comment 5 Kim Moir CLA 2011-05-09 16:45:58 EDT
verified in I20110509-1200
Comment 6 Oleg Besedin CLA 2011-05-17 14:59:06 EDT
The UI session tests fail because of JVM mismatch (64-bit vs 32-bit). The stack traces look like this:

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:216)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:193)
	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:101)
	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:690)
....

(see, for instance, http://fullmoon.ottawa.ibm.com/downloads/drops/I20110514-0800/testresults/macosx.cocoa.x86_5.0/org.eclipse.ui.tests.session.SessionTests.txt )

The session tests launch a nested Eclipse session using regular os/ws/arch options.

The following VM seems to be picked up:

vm=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java

I'd suggest to see if it is possible to either switch this computer to testing 64-bit stack or install 32-bit VM as default.
Comment 7 Kim Moir CLA 2011-05-18 14:56:23 EDT
We pass -d32 as an extraVMArgs value when invoking the tests so the 32 bit version of the vm is used.  

extraVMargs=-XstartOnFirstThread -d32

Do the session tests not inherit the properties of the VM that launched them?  

I'm concerned that it's a bit late to change to running our tests on a 64 bit SDK versus the 32 bit one we've been using all year.
Comment 8 Oleg Besedin CLA 2011-05-18 15:17:16 EDT
(In reply to comment #7)
> We pass -d32 as an extraVMArgs value when invoking the tests so the 32 bit
> version of the vm is used.  
> 
> extraVMargs=-XstartOnFirstThread -d32
> 
> Do the session tests not inherit the properties of the VM that launched them?  

Apparently they do not :-). Session test launch a separate process and explicitly re-use arguments such as os/ws/arch. They, for instance, don't inherit modified memory allocation arguments from the "outer" instance. 

> 
> I'm concerned that it's a bit late to change to running our tests on a 64 bit
> SDK versus the 32 bit one we've been using all year.

Is there an option to specify 32-bit JVM as default? Something under Applications -> Utilities -> Java Preferences?
Comment 9 Markus Keller CLA 2011-05-18 15:37:14 EDT
(In reply to comment #8)
> Is there an option to specify 32-bit JVM as default? Something under
> Applications -> Utilities -> Java Preferences?

Yes, you can reorder the VMs there, but unfortunately, this only affects /usr/bin/java, but not the /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java that Eclipse finds as default installed JRE. You can see this when you launch with
-showversion. It also doesn't work when I try to launch e.g. the ControlExample.


(In reply to comment #7)
> I'm concerned that it's a bit late to change to running our tests on a 64 bit
> SDK versus the 32 bit one we've been using all year.

I don't think that's a bigger change than upgrading the OS and the VM.
Comment 10 Kim Moir CLA 2011-05-18 16:35:57 EDT
Created attachment 196050 [details]
patch to switch to macosx cocoa x86_64 for testing
Comment 11 Kim Moir CLA 2011-05-19 11:16:30 EDT
Created attachment 196125 [details]
patch
Comment 12 Kim Moir CLA 2011-05-19 11:35:39 EDT
I reran the tests with this patch (to run with macosx cocoa x86_64) and the session tests still failed.  I'm deferring this bug to RC3.
Comment 13 Oleg Besedin CLA 2011-05-19 11:59:06 EDT
(In reply to comment #12)
> I reran the tests with this patch (to run with macosx cocoa x86_64) and the
> session tests still failed.  I'm deferring this bug to RC3.

Did they fail in the same way as in the comment 6?
Comment 16 Oleg Besedin CLA 2011-05-19 13:44:51 EDT
(In reply to comment #14)
> Here are the results

The session tests passed in this version, but there are 10 other tests that
failed. Hmm...
Comment 17 Oleg Besedin CLA 2011-05-19 15:42:58 EDT
Created attachment 196163 [details]
Possible temporary workaround for session tests
Comment 18 Oleg Besedin CLA 2011-05-19 15:53:58 EDT
Boris, could you try running session tests with the patch on your Mac?
Comment 19 Oleg Besedin CLA 2011-05-19 15:54:36 EDT
Paul, could you try running Session tests with the "Possible temporary workaround" on Linux?
Comment 20 Paul Webster CLA 2011-05-24 11:27:23 EDT
My tests all passed correctly.  I'd suggest you switch to "Constants.ARCH_X86.equals(arch)" though.   I know the JLS specs that all compiled string constants will be interned, but I believe something read into the properties is less reliable.

PW
Comment 21 Oleg Besedin CLA 2011-05-24 11:40:24 EDT
Created attachment 196451 [details]
Possible temporary workaround Update1

Good point, patch updated.
Comment 22 Remy Suen CLA 2011-05-24 12:33:36 EDT
The session tests passed for me with and without the patch on Windows XP (as expected). This looks safe to me.
Comment 23 Boris Bokowski CLA 2011-05-25 07:23:38 EDT
I can confirm that the patch fixes the problem on Cocoa (using Mac OS X 10.6.7), and that the session tests fail when not running with the patch. Note that I had to add "-d32" to the arguments in the UI session tests launch configuration for the "outer" test instance to come up.
Comment 24 Oleg Besedin CLA 2011-05-25 09:34:39 EDT
(In reply to comment #23)
> ... Note
> that I had to add "-d32" to the arguments in the UI session tests launch
> configuration for the "outer" test instance to come up.

Yes, that is as expected. This is how tests are currently run, see comment 1.
Comment 25 Oleg Besedin CLA 2011-05-25 10:25:53 EDT
(In reply to comment #23)
> I can confirm that the patch fixes the problem on Cocoa ...

I'll take that as a "+1" :-). Patch applied to CVS Head. Assuming this fixes immediate problem, I believe we need to switch to testing 64bit stack after 3.7 is released.
Comment 26 Kim Moir CLA 2011-08-15 17:06:45 EDT
I've opened bug 354774 for the changes to the testing framework.