Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestFlowRunner throws SWTException: Invalid thread access #9

Open
miguelalba opened this issue Apr 30, 2020 · 3 comments
Open

TestFlowRunner throws SWTException: Invalid thread access #9

miguelalba opened this issue Apr 30, 2020 · 3 comments

Comments

@miguelalba
Copy link

miguelalba commented Apr 30, 2020

Hi!

I am sorry if this issue has already been reported. I looked in the closed issues and could not find it. I am following the example from the readme.

	@Rule
	public ErrorCollector collector = new ErrorCollector();

	private static TestFlowRunner runner;

	@Before
	public void setUp() {
		TestrunConfiguration runConfiguration = new TestrunConfiguration();
		runConfiguration.setLoadSaveLoad(false);
		runner = new TestFlowRunner(collector, runConfiguration);
	}

In my test method I have

runner.runTestWorkflow(new File("workflows/InitializeParentsAnimals"));

This is a simple workflow with only three nodes but the TestFlowRunner does not execute, it fails at the beginning of the runTestWorkflow method:

The full trace is:

-------------------------------------------------------------------------------
Test set: de.bund.bfr.knime.fsklab.workflows.tests.WorkflowsTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.603 sec <<< FAILURE! - in de.bund.bfr.knime.fsklab.workflows.tests.WorkflowsTest
testChickenModels(de.bund.bfr.knime.fsklab.workflows.tests.WorkflowsTest)  Time elapsed: 2.514 sec  <<< ERROR!
org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:4533)
	at org.eclipse.swt.SWT.error(SWT.java:4448)
	at org.eclipse.swt.SWT.error(SWT.java:4419)
	at org.eclipse.swt.widgets.Display.error(Display.java:1090)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:840)
	at org.eclipse.swt.widgets.Display.create(Display.java:823)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:722)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:713)
	at org.eclipse.swt.widgets.Display.getDefault(Display.java:1420)
	at org.knime.workbench.core.KNIMECorePlugin.createImageRegistry(KNIMECorePlugin.java:501)
	at org.eclipse.ui.plugin.AbstractUIPlugin.getImageRegistry(AbstractUIPlugin.java:250)
	at org.knime.workbench.core.util.ImageRepository.getImage(ImageRepository.java:410)
	at org.knime.workbench.core.util.ImageRepository.getImage(ImageRepository.java:376)
	at nl.esciencecenter.e3dchem.knime.testing.TestFlowRunner.runTestWorkflow(TestFlowRunner.java:80)
	at de.bund.bfr.knime.fsklab.workflows.tests.WorkflowsTest.testChickenModels(WorkflowsTest.java:53)```
@sverhoeven
Copy link
Member

Are you on MacOSX?

Some solutions might be in #3

@miguelalba
Copy link
Author

Yes. So I get that I would need to run it with this profile?

<profiles>
    <profile>
        <id>macosx</id>
            <activation>
            <os>
                <name>mac os x</name>
                <family>mac</family>
            </os>
        </activation>
        <properties>
            <tycho.test.jvmArgs>-XstartOnFirstThread</tycho.test.jvmArgs>
            <custom.UIThread>false</custom.UIThread>
        </properties>
        <build>
    </build>
</profile>

@sverhoeven
Copy link
Member

Yep, for example in https://github.com/3D-e-Chem/knime-silicos-it/blob/master/tests/pom.xml#L138-L153 it is used and the workflow tests work on Travis CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants