`ActiveSessionException` in TestNG integration suggests conflict with parallel execution
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- java
- Domínio
- testing-qa
Direção de pesquisa
Comece com com.appland.appmap.process.hooks.test.TestNG.testng e o caminho de Recorder.start mostrado no stack trace; em seguida, inspecione RecordingSupport.startRecording e TestSupport.startRecording. Reproduza a falha com TestNG parallel="methods" ou parallel="tests" e determine se as sessões podem ser isoladas por thread ou se o paralelismo precisa ser desabilitado. Está concluído quando a execução paralela não causar mais ActiveSessionException e as gravações continuarem sendo concluídas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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)
- Linguagem predominante
- Java
- Estrelas
- 88
- Forks
- 17
- Merge médio
- 2d 2h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de getappmap/appmap-java
-
Labeled methods should always be recorded, even if they match trivial-method filtersTalvez já em andamento @kgilpin assumiu há 190 dias. Aberta
getappmap/appmap-java#323 · 1 reação · 2 responsáveis ·
-
Warning with Java 25Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
getappmap/appmap-java#322 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
getappmap/appmap-java#308 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
getappmap/appmap-java#304 ·
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
getappmap/appmap-java#296 ·
Todas as issues de getappmap/appmap-java
Issues semelhantes
-
backend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
bcgov/nr-forest-client#2524 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Sinytra/ForgifiedFabricAPI#298 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
team:Lumberjack
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
OpenLiberty/open-liberty#35998 ·
Mantenedores costumam responder em até 1 dia