Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

`ActiveSessionException` in TestNG integration suggests conflict with parallel execution

Ouverte
#305 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
java
Domaine
testing-qa

Piste de recherche

Commencez par com.appland.appmap.process.hooks.test.TestNG.testng et le chemin Recorder.start indiqué dans la stack trace, puis examinez RecordingSupport.startRecording et TestSupport.startRecording. Reproduisez l’échec avec TestNG parallel="methods" ou parallel="tests" et déterminez si les sessions peuvent être isolées par thread ou si le parallélisme doit être désactivé. C’est terminé lorsque l’exécution parallèle ne provoque plus de ActiveSessionException et que les enregistrements se terminent toujours correctement.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

A user running TestNG tests with the appmap-java agent is encountering an ActiveSessionException, which causes the recording to fail. We suspect this is due to TestNG's parallel execution feature, which the AppMap agent's Recorder may not currently support.

When multiple tests run concurrently, each test thread appears to trigger the AppMap TestNG hook (com.appland.appmap.process.hooks.test.TestNG.testng) and attempts to call startRecording. The first test succeeds, but subsequent concurrent tests fail when the Recorder detects that a session is already active, throwing the exception.

Error Log & Stack Trace

The key error message from the user's log is:

AppMap agent version 1.28.0 starting
[TestNG] Running:
  <path-to-project>\src\test\resources\testsuite\testing.xml
...
17:08:07.398 [main] WARN RecordingSupport.startRecording: com.appland.appmap.record.ActiveSessionException: an active recording session already exists
    at com.appland.appmap.record.Recorder$ActiveSession.set(Recorder.java:162)
    at com.appland.appmap.record.Recorder.start(Recorder.java:241)
    at com.appland.appmap.process.hooks.RecordingSupport.startRecording(RecordingSupport.java:59)
    at com.appland.appmap.process.hooks.test.TestSupport.startRecording(TestSupport.java:63)
    at com.appland.appmap.process.hooks.test.TestSupport.startRecording(TestSupport.java:25)
    at com.appland.appmap.process.hooks.test.TestNG.testng(TestNG.java:45)
Requested Action
  1. Investigate: Please confirm if appmap-java's TestNG support is compatible with parallel test execution (e.g., parallel="methods" or parallel="tests" in the testng.xml suite).
  2. Remediate:
    • Ideally: If possible, update the agent to properly support parallel TestNG execution, perhaps by managing recording sessions on a per-thread basis.
    • Alternatively: If parallel support is not feasible or as an interim solution, please add logic to detect when TestNG parallelism is enabled and automatically disable it (force serial execution) when the AppMap agent is attached. This would prevent the crash and allow users to generate AppMaps, albeit with a slower test run.
Full Terminal Output (for context)
"<path-to-java>\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 -Dappmap.config.file=<path-to-project>\appmap.yml -javaagent:<user-home>\.appmap\lib\java\appmap.jar "-javaagent:<path-to-ide>\lib\idea_rt.jar=56911" -javaagent:<user-home>\AppData\Local\JetBrains\IdeaIC\captureAgent\debugger-agent.jar -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Ddebugger.agent.enable.coroutines=true
 -Dkotlinx.coroutines.debug.enable.flows.stack.trace=true -Dkotlinx.coroutines.debug.enable.mutable.state.flows.stack.trace=true -Dfile.encoding=UTF-8 @<temp-path>\idea_arg_file1573352798 com.intellij.rt.testng.RemoteTestNGStarter -usedefaultlisteners
 false -socket56910 @w@<temp-path>\idea_working_dirs_testng2.tmp -temp <temp-path>\idea_testng2.tmp

AppMap agent version 1.28.0 starting

[TestNG] Running:

  <path-to-project>\src\test\resources\testsuite\testing.xml
Java HotSpot(TM) 64-Bit Server VM warning: Sharing 
is only supported for boot loader classes because bootstrap classpath 
has been appended

SLF4J(W): No SLF4J providers were found.
.. 
17:08:07.398 [main] WARN RecordingSupport.startRecording: com.appland.appmap.record.ActiveSessionException: an active recording session already exists

    at com.appland.appmap.record.Recorder$ActiveSession.set(Recorder.java:162)

    at com.appland.appmap.record.Recorder.start(Recorder.java:241)

    at com.appland.appmap.process.hooks.RecordingSupport.startRecording(RecordingSupport.java:59)

    at com.appland.appmap.process.hooks.test.TestSupport.startRecording(TestSupport.java:63)

    at com.appland.appmap.process.hooks.test.TestSupport.startRecording(TestSupport.java:25)

    at com.appland.appmap.process.hooks.test.TestNG.testng(TestNG.java:45)
Langage dominant
Java
Étoiles
88
Forks
17
Merge moyen
2 j 2 h
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de getappmap/appmap-java

Toutes les issues de getappmap/appmap-java

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.