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

Graphical editor SWTBot tests failing #2018

Closed
lwrage opened this issue Oct 9, 2019 · 16 comments · Fixed by #2174
Closed

Graphical editor SWTBot tests failing #2018

lwrage opened this issue Oct 9, 2019 · 16 comments · Fixed by #2174

Comments

@lwrage
Copy link
Contributor

@lwrage lwrage commented Oct 9, 2019

Summary

Some tests fail after the upgrade to Eclipse 2019-09. This happens on Linux, macOS, and Windows.

I have disabled the tests for now.

Environment

  • OSATE Version: nightly
  • Operating System: all
@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 9, 2019

Do you know if it is a problem with the tests or a problem with the graphical editor?

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Oct 9, 2019

There seems to be a timeout in recognizing that the "new project" dialog has opened.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 9, 2019

Do you have a log of that. I tried to take a quick look and I'm unable to reproduce that issue.

I am getting a legitimate test failure. Appears to be caused by something outside the GE. I'll add another comment with details when I have them.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 9, 2019

Okay. I am unable to reproduce the "New Project" dialog issue. A log would be helpful.

I am consistently getting an error when trying to rename connections. It is unclear what is causing it but it appears to be a problem with the test and not the GE. Will prioritize once development restarts.

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Oct 9, 2019

I get the timeout when I run the GE tests inside eclipse: right click on the ge test project, run as -> junit plug-in test. Initially it also complained that I wasn't running the osate2 product but I updated that in the run configuration. Two tests hang with an open "new" dialog. It looks like a problem with the test.

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Oct 9, 2019

There was another more pressing build issue. I'll provide more detail once the jenkins builds are back to normal.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 9, 2019

Your issue is caused by "Run in UI thread" being checked. I usually launch the tests using a SWTBot Test configuration rather than a JUnit Plug-in Test configuration so I"m not sure if there are any other pitfalls in doing it that way.

We won't be able to take a deep look until we resume work so no rush. I just took a quick look to check if it was something that would prevent usage of the editor. The issue that I'm seeing appears to be with the test.

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Oct 9, 2019

Oh, I should have remembered this. So the timeout is a non-issue. I'll check for the problem that made the jenkins build fail.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 9, 2019

I'm hoping it is the same one that makes it fail on my system. At least then it would be consistent.

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Oct 10, 2019

From the build log:

testGraphicalEditor(org.osate.ge.tests.endToEnd.PrimaryEndToEndTest)  Time elapsed: 64.414 s  <<< ERROR!
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find menu item matching: with mnemonic 'Rename...'
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.createHardwareProject(PrimaryEndToEndTest.java:268)
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.testGraphicalEditor(PrimaryEndToEndTest.java:35)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find menu item matching: with mnemonic 'Rename...'
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.createHardwareProject(PrimaryEndToEndTest.java:268)
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.testGraphicalEditor(PrimaryEndToEndTest.java:35)

Running as swtbot test I get the same exception:

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find menu item matching: with mnemonic 'Rename...'
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:474)
	at org.eclipse.swtbot.swt.finder.SWTBot.waitUntilWidgetAppears(SWTBot.java:1)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotRootMenu.menu(SWTBotRootMenu.java:126)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotRootMenu.menu(SWTBotRootMenu.java:110)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotRootMenu.menu(SWTBotRootMenu.java:89)
	at org.osate.ge.tests.endToEnd.util.UiTestUtil.clickContextMenuOfOutlineViewItem(UiTestUtil.java:499)
	at org.osate.ge.tests.endToEnd.util.OsateGeTestCommands.renameElementFromOutlineView(OsateGeTestCommands.java:505)
	at org.osate.ge.tests.endToEnd.util.OsateGeTestCommands.createConnectionAndLayout(OsateGeTestCommands.java:388)
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.createHardwareProject(PrimaryEndToEndTest.java:268)
	at org.osate.ge.tests.endToEnd.PrimaryEndToEndTest.testGraphicalEditor(PrimaryEndToEndTest.java:35)
	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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
	at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:120)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Testable.lambda$0(E4Testable.java:76)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find menu item matching: with mnemonic 'Rename...'
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:524)
	at org.eclipse.swtbot.swt.finder.SWTBot.waitUntil(SWTBot.java:1)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:498)
	at org.eclipse.swtbot.swt.finder.SWTBot.waitUntil(SWTBot.java:1)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:486)
	at org.eclipse.swtbot.swt.finder.SWTBot.waitUntil(SWTBot.java:1)
	at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:468)
	... 35 more

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Oct 10, 2019

Thanks. That is the same error I'm receiving so at least it is reproducible.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Jan 15, 2020

@lwrage do you mind running the tests again locally and on the build server with the current master? I am no longer able to reproduce it. I'm wondering if this is somehow related to the context menu issues that were affecting the xtext outline as well.

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Jan 15, 2020

Given that the failures occurred in the outline view context menu I'd say you're right. Tests run ok on my laptop.

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Jan 17, 2020

How do you feel about re-enabling the tests? Does this need to remain open?

@lwrage
Copy link
Contributor Author

@lwrage lwrage commented Jan 17, 2020

I expect them to work. Could you create a PR that enables them?

@philip-alldredge
Copy link
Collaborator

@philip-alldredge philip-alldredge commented Jan 17, 2020

Done

@lwrage lwrage changed the title Graphical editor SWTBot tests fail with Eclipse 2019-09 Graphical editor SWTBot tests failing Jan 17, 2020
Graphical Editor Enhancements automation moved this from Other to Done Jan 17, 2020
@lwrage lwrage added this to the 2.7.0 milestone Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants