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

Groovy JUnit test causes UI freeze when Run As context menu is opened #343

Closed
mpiggott opened this issue Sep 25, 2017 · 2 comments
Closed
Assignees

Comments

@mpiggott
Copy link

If a JUnit test written in groovy, similar to the above using the context menu and attempting to open Run As causes a freeze (stack below). The test I was looking at: https://github.com/sonatype/nexus-public/blob/master/components/nexus-repository/src/test/java/org/sonatype/nexus/repository/storage/StorageTxImplTest.groovy

   java.lang.Thread.State: RUNNABLE
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Throwable.java:783)
        - locked <0x00000000ec5dbe60> (a groovyjarjarantlr.MismatchedTokenException)
        at java.lang.Throwable.<init>(Throwable.java:265)
        at java.lang.Exception.<init>(Exception.java:66)
        at groovyjarjarantlr.ANTLRException.<init>(ANTLRException.java:17)
        at groovyjarjarantlr.RecognitionException.<init>(RecognitionException.java:43)
        at groovyjarjarantlr.MismatchedTokenException.<init>(MismatchedTokenException.java:106)
        at groovyjarjarantlr.Parser.match(Parser.java:211)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multipleAssignmentDeclarationStart(GroovyRecognizer.java:8199)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1344)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.blockBody(GroovyRecognizer.java:1787)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.openBlock(GroovyRecognizer.java:8862)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.variableDefinitions(GroovyRecognizer.java:2747)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.declaration(GroovyRecognizer.java:2548)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.classField(GroovyRecognizer.java:6336)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.classBlock(GroovyRecognizer.java:5611)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.classDefinition(GroovyRecognizer.java:2233)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.typeDefinitionInternal(GroovyRecognizer.java:2086)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1473)
        at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:865)
        at org.codehaus.groovy.antlr.ErrorRecoveredCSTParserPlugin.transformCSTIntoAST(ErrorRecoveredCSTParserPlugin.java:64)
        at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:113)
        at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:248)
        at org.codehaus.groovy.control.CompilationUnit$8.call(CompilationUnit.java:182)
        at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:622)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:598)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:575)
        at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:220)
        at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyParser.dietParse(GroovyParser.java:388)
        at org.codehaus.jdt.groovy.integration.internal.MultiplexingCommentRecorderParser.dietParse(MultiplexingCommentRecorderParser.java:58)
        at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:827)
        at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:395)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1162)
        at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:706)
        at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1190)
        at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:813)
        at org.eclipse.jdt.internal.junit.launcher.JUnit4TestFinder.internalIsTest(JUnit4TestFinder.java:232)
        at org.eclipse.jdt.internal.junit.launcher.JUnit4TestFinder.isTest(JUnit4TestFinder.java:200)
        at org.eclipse.jdt.internal.junit.util.CoreTestSearchEngine.isTestOrTestSuite(CoreTestSearchEngine.java:57)
        at org.eclipse.jdt.internal.junit.JUnitPropertyTester.isJUnitTest(JUnitPropertyTester.java:117)
        at org.eclipse.jdt.internal.junit.JUnitPropertyTester.canLaunchAsJUnitTest(JUnitPropertyTester.java:85)
        at org.eclipse.jdt.internal.junit.JUnitPropertyTester.test(JUnitPropertyTester.java:69)
        at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
        at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:100)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:51)
        at org.eclipse.core.internal.expressions.AdaptExpression.evaluate(AdaptExpression.java:112)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:51)
        at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:160)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:51)
        at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:75)
        at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:51)
        at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:55)
        at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:281)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction.isApplicable(ContextualLaunchAction.java:287)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction.fillMenu(ContextualLaunchAction.java:218)
        at org.eclipse.debug.ui.actions.ContextualLaunchAction$1.menuShown(ContextualLaunchAction.java:141)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:256)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:802)
        at org.eclipse.jface.action.ActionContributionItem.copyMenu(ActionContributionItem.java:1242)
        at org.eclipse.jface.action.ActionContributionItem.handleShowProxy(ActionContributionItem.java:1222)
        at org.eclipse.jface.action.ActionContributionItem.lambda$7(ActionContributionItem.java:1185)
        at org.eclipse.jface.action.ActionContributionItem$$Lambda$226/14181307.handleEvent(Unknown Source)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1084)
        at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:5204)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4872)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:359)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1657)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2199)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5191)
        at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
        at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:262)
        at org.eclipse.swt.widgets.Display.runPopups(Display.java:4279)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3811)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
        at org.eclipse.ui.internal.Workbench$$Lambda$65/1442768482.run(Unknown Source)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        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 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1499)

   Locked ownable synchronizers:
        - None
@eric-milles
Copy link
Member

Run As requires checking for test methods to display Run As > JUnit Test. I was able to view and bring up the context menus for this file with no issue. You may want to rebuild your Java indexes. And if you could open the Groovy Event Console in the Console view, you may get some more details as to what's going on.

@eric-milles eric-milles self-assigned this Oct 1, 2017
@eric-milles
Copy link
Member

@mpiggott Could you try again with the latest snapshot? I was able to import the projects and use the selected file without UI sluggishness. You may also consider adding more memory to Eclipse. In eclipse.ini, I add -Xmx1g to the -vmargs section (usually the end of the file).

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