Community
Participate
Working Groups
Test_org_eclipse_swt_widgets_Display.test_getActiveShell() fails with the following stack trace in recent builds (M3 candidate [1] for example) expected same:<Shell {test_getActiveShell}> was not:<null> java.lang.AssertionError: expected same:<Shell {test_getActiveShell}> was not:<null> at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Display.test_getActiveShell(Test_org_eclipse_swt_widgets_Display.java:223) at org.eclipse.test.TracingSuite.runChild(TracingSuite.java:265) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:754) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:351) at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:37) at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:33) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) at org.eclipse.equinox.launcher.Main.main(Main.java:1492) at org.eclipse.core.launcher.Main.main(Main.java:34) [1] http://download.eclipse.org/eclipse/downloads/drops4/I20161027-0700/testresults/html/org.eclipse.swt.tests_ep47I-unit-mac64_macosx.cocoa.x86_64_8.0.html
FWIW I cannot reproduce this test failure locally with the latest master on Mac OS X 10.11.
New Gerrit change created: https://git.eclipse.org/r/84233
Gerrit change https://git.eclipse.org/r/84233 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=294b7331385091a2ce76ab4d725cb77c219fc033
The test does fail for me on macOS 10.12.1. Looks like the window manager opens the shell asynchronously and getActiveShell() only returns the opened shell after some delay. I didn't find an API on Shell that would guarantee that the shell becomes active immediately. They all say something like "asks the window manager to make the shell active". When running the test as part of the suite, a delay of 100ms was enough on my system, but when running the test individually, it needed at least 150ms. Added this delay to the test. The test was already disabled on GTK, probably for the same reason. Re-enabled it on GTK as well.