CodeLens missing and individual method execution freezes on @Nested JUnit 6 classes (macOS)

未关闭
#1,897 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
java, macos, spring-boot, typescript, vscode

调研方向

在 macOS 上,使用嵌套的 JUnit 5 类和 Testcontainers,通过 Spring Boot 的 @DataJpaTest 在 vscode-java-test 扩展中复现该问题。首先跟踪嵌套类的 CodeLens 和 Test Explorer 行为;当嵌套类和方法显示 CodeLens,并且运行一个嵌套方法能够完成且不会冻结时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

ai-triaged bug investigating junit test-discovery test-execution

Type: Bug

When using @Nested test classes in JUnit 5 (with Spring Boot @DataJpaTest / Testcontainers), the extension fails to render CodeLens buttons for inner classes and freezes when running individual nested test methods from the Test Explorer.

Environment
  • OS: macOS (zsh)
  • VS Code Extension: Test Runner for Java (vscjava.vscode-java-test)
  • Framework: Spring Boot + JUnit 5 + Testcontainers
Steps to Reproduce
  1. Create a main test class annotated with @DataJpaTest and @Import(TestcontainersConfiguration.class).
  2. Create inner classes annotated with @Nested and @DisplayName.
  3. Open the file in VS Code.
Expected Behavior
  1. CodeLens ("Run | Debug") should appear above @Nested inner classes and their @Test methods.
  2. Running a single @Test method from inside a @Nested class via the Test Explorer panel should execute cleanly.
Actual Behavior
  1. CodeLens buttons are missing above @Nested inner classes.
  2. Triggering a single test method inside @Nested from the Test Explorer hangs/freezes indefinitely (likely due to nested class $ delimiter escaping issues in macOS zsh or context inheritance failures).
Workaround attempted

Adding @NestedTestConfiguration(INHERIT) and setting spring.test.nested.class.execution=INHERIT did not prevent the runner from hanging when selecting individual nested methods.

Extension version: 0.46.0
VS Code version: Code 1.131.0 (e4c7e7b1d6d060162f4aa7f8225271b67ce1df75, 2026-07-28T10:51:25Z)
OS version: Darwin arm64 25.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Pro, Version 26.5.2 (Build 25F84))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.5.2 ACTIVE
Machine model name: MacBookPro
Machine model version: 18.1
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 4, 4, 3
Memory (System) 16.00GB (0.08GB free)
Process Argv --crash-reporter-id 9d2ff9aa-dc31-484a-a943-bcece3ff6fb5
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
pythonvspyt551cf:31249601
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
839jf696:31457053
ec5jj548:31422691
cp_cls_t_966_ss:31526232
8hhj4413:31478653
cp_cls_t_1081:31454832
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
chat:31457767
7e187181:31503455
ghj88844:31499326
ddid_c:31478207
hmra_i5g22:31518061
bjc72774_agent_sandbox:31557830
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
748c7209:31512887
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
jh5f2457_c:31540921
41836166:31537719
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
h561g132:31533256
sessions_3:31532893
ihg5j128:31534457
f412h606:31551416
7g2b5551:31542111
sandbox-ui-on-2:31543161
5fe6f778:31554331
allow-none:31555437
fd5dc207:31551400
c7c27ce7:31554789
8hc4g144:31558143
0dg73464:31554319
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
session-archive:31558132

主要语言
TypeScript
星标
340
派生
173
平均合并
1 天 2 小时
30 天内合并 PR
17

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-java-test 的其他 Issue

查看 microsoft/vscode-java-test 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。