mastodon-sc/mastodon

Travis CI fails all the time since feature PR.

Closed this issue · 1 comments

From @tpietzsch:

The failed tests on Travis are probably all due to AWT being used.
I modified one of the "erroring" tests to explicitly catch all exceptions and print to stdout.
ec34e21

Travis says:

Running org.mastodon.feature.update.UpdateStackSerializationSeriesTest
WARNING: Creating property map for a collection/pool that does not manage PropertyMaps!
WARNING: Creating property map for a collection/pool that does not manage PropertyMaps!
WARNING: Creating property map for a collection/pool that does not manage PropertyMaps!
WARNING: Creating property map for a collection/pool that does not manage PropertyMaps!
Jul 18, 2019 11:21:37 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
TrackScheme style file /home/travis/.mastodon/trackschemestyles.yaml not found. Using builtin styles.
Bdv style file /home/travis/.mastodon/rendersettings.yaml not found. Using builtin styles.
ColorMap file /home/travis/.mastodon/colormaps.yaml not found. Using builtin colormaps.
Feature color mode file /home/travis/.mastodon/colormodes.yaml not found. Using builtin styles.
Keymap list file /home/travis/.mastodon/keymaps//keymaps.yaml not found. Using builtin styles.
java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
	at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
	at java.awt.Window.<init>(Window.java:536)
	at java.awt.Frame.<init>(Frame.java:420)
	at java.awt.Frame.<init>(Frame.java:385)
	at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1763)
	at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1838)
	at javax.swing.JDialog.<init>(JDialog.java:272)
	at javax.swing.JDialog.<init>(JDialog.java:206)
	at org.mastodon.revised.mamut.TgmmImportDialog.<init>(TgmmImportDialog.java:62)
	at org.mastodon.revised.mamut.ProjectManager.<init>(ProjectManager.java:112)
	at org.mastodon.revised.mamut.WindowManager.<init>(WindowManager.java:163)
	at org.mastodon.feature.update.UpdateStackSerializationSeriesTest.createProjectWithPendingChanges(UpdateStackSerializationSeriesTest.java:96)
	at org.mastodon.feature.update.UpdateStackSerializationSeriesTest.test(UpdateStackSerializationSeriesTest.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.043 sec <<< FAILURE!
A simple workaround is disabling these tests on Travis, something like this
https://github.com/bigdataviewer/bigdataviewer-vistools/blob/d6479aef7e4994e94b68d9c3aee6f160a188d6e4/src/test/java/bdv/util/BdvHandlePanelGarbageCollectionTest.java#L22

A better fix would be to fix ProjectManager etc to be able to run headless.

This is fixed in #106 by making the tests run headless by not requiring ProjectManager. (Decoupling all UI from ProjectManager was too difficult...)