`ActiveSessionException` in TestNG integration suggests conflict with parallel execution
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
- Investigate: Please confirm if
appmap-java's TestNG support is compatible with parallel test execution (e.g.,parallel="methods"orparallel="tests"in thetestng.xmlsuite). - 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
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getappmap/appmap-java
-
Labeled methods should always be recorded, even if they match trivial-method filtersPeut-être pris @kgilpin l’a pris il y a 189 jours. Ouverte
getappmap/appmap-java#323 · 1 réaction · 2 personnes assignées ·
-
Warning with Java 25Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
getappmap/appmap-java#322 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
getappmap/appmap-java#308 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
getappmap/appmap-java#304 ·
-
enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
getappmap/appmap-java#296 ·
Toutes les issues de getappmap/appmap-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NationalSecurityAgency/ghidra#9748 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
spring-mcp-tools
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
explyt/spring-plugin#591 ·
Les mainteneurs répondent en général sous 1 jour
-
waiting-for-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 84/100
ADORSYS-GIS/keycloak-oid4vp-plugin#221 ·
Les mainteneurs répondent en général sous 2 jours