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

Stack size too large when tests started from IntelliJ 2017.2 #788

Closed
yackx opened this issue Nov 15, 2017 · 2 comments
Closed

Stack size too large when tests started from IntelliJ 2017.2 #788

yackx opened this issue Nov 15, 2017 · 2 comments

Comments

@yackx
Copy link

yackx commented Nov 15, 2017

Issue description

The units tests in our Grails 3.2.6 project with Spock have stopped working when launched from IntelliJ 2017.2.5 (right-click on the test folder, Run as unit tests). Exception with Stack size too large message appears, tests won't start.

Exception in thread "main" java.lang.VerifyError: (class: our/projects/SomeNiceSpec, method: $spock_feature_1_3 signature: ()V) Stack size too large
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:18)
	at com.intellij.junit4.JUnit46ClassesRequestBuilder.collectWrappedRunners(JUnit46ClassesRequestBuilder.java:75)
	at com.intellij.junit4.JUnit46ClassesRequestBuilder.getClassesRequest(JUnit46ClassesRequestBuilder.java:47)
	at com.intellij.junit4.JUnit4TestRunnerUtil.buildRequest(JUnit4TestRunnerUtil.java:89)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:46)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Process finished with exit code 1
Empty test suite.

How to reproduce

  • It was working fine until a benign change that has nothing to do with the failing our/projects/SomeNiceSpec was merged to the codebase.
  • The test involved is fairly simple, and uses the same boring testing pattern found widely in the rest of the app.
  • The tests still work fine when launched by Gradle (:server:cleanTest :server:test with --tests *) but fail when launched from the IJ (appear under JUnit in the Run/Debug Configuration dialog box).
  • I cannot reproduce the code here as it's my customer property, and anyways it would not allow you to reproduce the issue unless it'd make a large project available.
  • I do not have a simple reproducible sequence - sorry, again, it stopped working when unrelated code was added.

No influence:

  • IJ specific version; I've tested with 2017.2.6 and 2017.2.5
  • JDK specific version; I've tested with 8u121 and 8u152-zulu

Workaround

We noticed that by removing the first and: declaration in the following test, it worked again:

void "save train (...)"() {
    given:
    dataset.uniqueCompanyDataset.withTrainParkingSpendingPlan()

    and: // remove this line and it works again
    def info = new ConfigCompanySpendingPlanInfoListItem(
            language: Language.fr,
            text: 'train parking fr',
            moreInfoUrl: 'http://unbox.work/fr/more',
            termsAndConditionsUrl: 'http://unbox.work/fr/terms'
    )

    and:
    mockLoggedInUser(service, dataset.uniqueEmployee)

    when: "you save the info"
    service.saveInfo(info)

    then:
    thrown(TenantAccessException)
}

I realize this is not much to work on but at least Google may lead you here and this workaround may apply to you.

Additional Environment information

IntelliJ IDEA 2017.2.5
Build #IU-172.4343.14, built on September 26, 2017
JRE: 1.8.0_152-release-915-b12 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

IJ launch command (super long classpath truncated):

/Users/youri/.sdkman/candidates/java/8u152-zulu/bin/java -ea -Didea.test.cyclic.buffer.size=66560000 "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=53440:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/junit/lib/junit5-rt.jar:.......:/Users/youri/.m2/repository/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 @w@/private/var/folders/xw/bnk1k9jn3knfbdzmqpqz_xcm0000gn/T/idea_working_dirs_junit.tmp @/private/var/folders/xw/bnk1k9jn3knfbdzmqpqz_xcm0000gn/T/idea_junit.tmp -socket53439

See Also

#58

@leonard84
Copy link
Member

As already said in #58 it seems to be an Intellij issue, could you please file a bug at https://youtrack.jetbrains.com/issues/IDEA

@slavabedr
Copy link

https://youtrack.jetbrains.com/issue/IDEA-190064

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

No branches or pull requests

3 participants