getappmap / appmap-java

AppMap client agent for Java
Other
80 stars 14 forks source link

Message "there is no active recording session" shown when executing tests with AppMap #213

Closed jansorg closed 10 months ago

jansorg commented 1 year ago
  1. Tested project: https://github.com/TooTallNate/Java-WebSocket/tree/master
  2. Opened in IntelliJ Community 2023.2 with the latest AppMap plugin 0.48.0
  3. Imported as "Maven"
  4. Navigated to the Maven tool window and executed the mvn test task with the "Execute with AppMap" menu item
  5. Tests executed
  6. Message "there is no active recording session" is unexepcted printed to STDOUT (or STDERR, I'm not sure). I'm unsure if it's a bug in the agent. If it isn't, then IMHO messages like this shouldn't be printed to STDOUT/STDERR to not confuse the developer.
[ERROR] org.java_websocket.issues.Issue834Test.testNoNewThreads  Time elapsed: 0.024 s  <<< ERROR!
com.appland.appmap.record.ActiveSessionException: there is no active recording session
    at com.appland.appmap.record.Recorder$ActiveSession.get(Recorder.java:99)
    at com.appland.appmap.record.Recorder.getMetadata(Recorder.java:212)
    at com.appland.appmap.process.hooks.remoterecording.ServletHooks.stopRecording(ServletHooks.java:62)
    at com.appland.appmap.process.hooks.remoterecording.ServletHooks.stopRecording(ServletHooks.java:54)
    at com.appland.appmap.process.hooks.remoterecording.ServletHooks.junit(ServletHooks.java:82)
    at org.java_websocket.issues.Issue834Test.testNoNewThreads(Issue834Test.java:47)
    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: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.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
    at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.lang.Thread.run(Thread.java:833)
apotterri commented 10 months ago

This was a bug in the agent. As of v1.23.0, it no longer happens, and AppMaps are created for the tests.