Skip to content

JUnit tests fail with java.lang.InternalError: no stack frame matched test class #306

Closed

Description

@jansorg

Sometimes, unit tests (JUnit 4 via Gradle) fail with the stacktrace below. This does not happen everytime, as far as I can tell.
Test failure on CI: https://github.com/getappmap/appmap-intellij-plugin/actions/runs/18888383411/job/53909609198#step:6:2394

    java.lang.InternalError: no stack frame matched test class 
    	at com.appland.appmap.process.hooks.test.TestSupport.findErrorFrame(TestSupport.java:76) 
    	at com.appland.appmap.process.hooks.test.JUnit.junitTest(JUnit.java:34) 
    	at appland.toolwindow.runtimeAnalysis.RuntimeAnalysisModelTest.hierarchy(RuntimeAnalysisModelTest.java:106) 
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) 
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    	at java.base/java.lang.reflect.Method.invoke(Method.java:568) 
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) 
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) 
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) 
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) 
    	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 
    	at com.intellij.testFramework.UsefulTestCase.lambda$wrapTestRunnable$13(UsefulTestCase.java:504) 
    	at com.intellij.testFramework.UsefulTestCase.runTestRunnable(UsefulTestCase.java:408) 
    	at com.intellij.testFramework.fixtures.BasePlatformTestCase.runTestRunnable(BasePlatformTestCase.java:109) 
    	at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:424) 
    	at com.intellij.testFramework.UsefulTestCase.runBare(UsefulTestCase.java:494) 
    	at com.intellij.testFramework.UsefulTestCase$1.evaluate(UsefulTestCase.java:156) 
    	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) 
    	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) 
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) 
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) 
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) 
    	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) 
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) 
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) 
    	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) 
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) 
    	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) 
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:413) 
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:112) 
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58) 
    	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40) 
    	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:54) 
    	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:53) 
    	at jdk.internal.reflect.GeneratedMethodAccessor49.invoke(Unknown Source) 
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    	at java.base/java.lang.reflect.Method.invoke(Method.java:568) 
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 
    	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) 
    	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:92) 
    	at jdk.proxy3/jdk.proxy3.$Proxy48.processTestClass(Unknown Source) 
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:183) 
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:132) 
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:103) 
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:63) 
    	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56) 
    	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:122) 
    	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:72) 
    	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69) 
    	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74) 

Activity

  1. dividedmind commented on Oct 30, 2025

    @dividedmind
    Contributor

    This happens when the test fails by rethrowing an exception raised in another thread. In this scenario, the test itself is not in the stack trace of the exception, which causes this error. #307 should fix it (once I get it to pass CI). You're welcome to grab this code and verify — I was able to reproduce the problem reliably by modifying the test in question to always fail by changing the expected value.

  2. appland-release commented on Nov 11, 2025

    @appland-release

    🎉 This issue has been resolved in version 1.28.1 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions