Preserve valid TAP when unsupported fork follows a fixed plan
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start by reading SystemOperator.fork() and the fixed-plan handling in Test::Builder, then trace how the fork handler decides whether to emit a whole-file skip plan. Add focused regression coverage for a fixed plan followed by unsupported fork() before the first assertion. Confirm valid TAP with the planned assertions skipped on JVM and interpreter, check standard Perl behavior, and rerun Test-UsedModules 0.03 Build test.
由索引模型根據 Issue 內容生成。
描述
Summary
When a test declares a fixed Test::More plan and then reaches PerlOnJava's unsupported fork(), the fork handler emits a second top-level 1..0 # SKIP plan and exits. The original plan has already been printed even when no assertions have run, so TAP is invalid. This breaks Test-UsedModules 0.03 t/02_self.t on both JVM and interpreter backends.
Reproduction
The archived CPAN run 20261129-192130-74689 reports:
t/00_compile.tandt/01_export_ok.t: pass.t/02_self.t: fails withParse errors: More than one plan found in TAP outputandBad plan. You planned 3 tests but ran 0.t/03_succ.tandt/04_fail.t: explicitly skipped because fork is unsupported on the Java/JVM platform.
The failing test has this structure:
use Test::UsedModules;
use Test::More;
all_used_modules_ok();
done_testing;
all_used_modules_ok() calls its Test::Builder object's plan(tests => 3) before checking files. Its first check calls fork() before any assertion has run. PerlOnJava writes 1..3, then the unsupported-fork path writes 1..0 # SKIP fork() not supported on this platform (Java/JVM) to the same TAP stream. The TAP parser consequently rejects the file.
Root cause
SystemOperator.fork() uses current_test() == 0 to decide that it can emit a whole-file skip plan. That condition does not mean no TAP plan has been declared or printed: a fixed plan may already be active while the assertion count is still zero. The later fixed-plan handling fills remaining assertions with Test::Builder::skip(), but it is reached only after the zero-current-test branch.
The same failure was reproduced with the CPAN Build test command on JVM and interpreter backends. Direct execution of t/02_self.t on both backends emitted the two plans. System Perl's focused prove -Ilib t/02_self.t passed (3 tests), and the archived full system-Perl oracle passed all five files (23 tests).
Expected behavior
When a fixed plan is already active, unsupported fork() should preserve valid TAP by marking the remaining planned assertions skipped, including when zero assertions have run. It should not append a second top-level plan. Keep the existing whole-file skip behavior for tests that have emitted no plan.
Acceptance evidence
- Add focused regression coverage for a fixed Test::More plan followed by unsupported
fork()before the first assertion. - Confirm the TAP is valid and the planned assertions are represented as skipped on JVM and interpreter.
- Validate the test's standard-Perl behavior with system Perl.
- Re-run
Test-UsedModules0.03Build test; the two fork-only files may remain intentionally skipped, butt/02_self.tshould no longer fail TAP parsing.
This is a TAP handling defect around an unsupported operation; it does not request implementing fork().
Related qualification tracker: #1646. That tracker records unsupported-fork exclusions but does not cover this invalid-TAP case.
- 主要語言
- Perl
- 星號
- 67
- 分支
- 9
- 平均合併
- 6 小時 45 分鐘
- 30 天內合併 PR
- 104
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
fglock/PerlOnJava 的其他 Issue
-
area:cpan-port area:performance bug
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#2230 ·
維護者通常 1 天內回覆
-
area:runtime documentation enhancement
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#1579 ·
維護者通常 1 天內回覆
-
area:ownership area:performance area:runtime bug
難度 5/5 一週以上 新手友好度 35/100
fglock/PerlOnJava#2232 ·
維護者通常 1 天內回覆
-
area:parser area:runtime area:unicode bug
難度 5/5 一週以上 新手友好度 38/100
fglock/PerlOnJava#2228 ·
維護者通常 1 天內回覆
-
area:cpan-port area:runtime bug
難度 3/5 1-2 天 新手友好度 70/100
fglock/PerlOnJava#2227 ·
維護者通常 1 天內回覆
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
Make logo .svg未關閉documentation
難度 2/5 1-3 小時 新手友好度 65/100
larchanka/ppc-code-ai-agent#38 ·
維護者通常 1 天內回覆
-
[doc] perlsub wrongly says that `"sub { ... }" creates a new subroutine each time it is executed'未關閉documentation Needs Triage
難度 2/5 1-3 小時 新手友好度 69/100
維護者通常 1 天內回覆
-
docs(api): /api/v3/external_sources spec is missing lc and section_title可能已有人在做 @subhwastaken 今天認領。 未關閉
難度 1/5 1-3 小時 新手友好度 82/100
openfoodfacts/openfoodfacts-server#15626 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 67/100
LMS-Community/slimserver#1742 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100