Repository navigation
ci: reuse prebuilt embedded race binaries - #29167
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
P2 — 当前 exact head d5c0890e4118311ff9460f1ad209dbe5819fc3af 暂不能 PASS(自有 PR,按规则只提交 COMMENT)。
optools/ut_embedded_schedule_test.go:44-73 将 go tool test2json 整体替换为 shell mock;测试没有真正启动生成的 test binary,也没有建立 test2json→binary 的输出管道。TERM-resistant 场景只验证 mock 自身忽略 TERM,未验证真实执行器在 leader 退出、后代进程仍存活或持有输出管道时的行为。
对应风险路径在 optools/run_ut.sh:2003-2011:取消/超时后需要证明后代进程组消失、管道关闭、产物清理且失败状态保留。当前 exact-head Linux CI、bash 语法和 diff 检查通过,但这些证据不能覆盖该进程拓扑生命周期缺口;Darwin UT 也未执行。
建议补充最小真实 test2json + 子进程 fixture,分别覆盖超时和外层取消,并断言上述生命周期结果。当前未确认实现本身已有泄漏或挂死,仅是该高风险契约缺少有效验证。
What type of PR is this?
Which issue(s) this PR relates to
Related to #28419 (UT producer cost). Follow-up to merged #29157.
Why
Recent successful race jobs vary from about 34 minutes to 52–57 minutes. The slowdown is broad across stages and correlates with roughly 2x CPU work plus materially higher CPU/I/O pressure, rather than cluster-admission waiting alone. In the latest #29157 run, embedded packages still occupied about 17m54s of the serial critical path.
The embedded group currently contains nine race packages after the exclusive
pkg/tests/issuespackage is removed. Each package has a large compile/link cost. The old optional prebuild only warmed the Go cache, deleted the produced binaries, and then askedgo testto compile/link the complete scope again. A local coldpkg/embedrace binary build took multiple minutes under load and produced a 256 MiB binary; this is directional evidence of material link work, not a CI speedup measurement.Design
go tool test2json.-race/tag-aware package metadata before executing any binary. Any build, artifact, metadata, disk-headroom, or configuration failure falls back to the authoritative complete-scopego testbefore partial execution.-short, race instrumentation, package identity,TestMain,-count=1, panic-on-exit, package working directory, runtime library path, and JSON output.UT_TIMEOUT + 120s, coveringTestMaincleanup and inherited-output drain beyond Go's internal test timer. TERM escalates to KILL for the complete process group.UT_REPORT; scheduler diagnostics go to stderr only.run_ut.shand the Makefile. Stronger runners can still override the controls.The theoretical critical-path saving is bounded by
min(issues duration, embedded compile/link duration), minus any slowdown imposed on issues by the single compiler and small per-package launch overhead. This PR does not claim a measured whole-job speedup; CI stage checkpoints will show the actual result.Failure and cancellation contracts
The scheduler tests cover:
The parent gives this two-group helper a 15-second cleanup budget, longer than the helper's 5-second TERM-to-KILL window, so it cannot kill the cleanup owner first.
Validation
bash -n optools/run_ut.sh: PASSgit diff --check origin/main...HEAD: PASSgo test ./optools -run '^TestEmbeddedPrebuild' -count=1: PASSgo test ./optools -count=1: PASS, 44.873s after rebase ontocd5feff242One local direct-binary probe produced valid
test2jsonfailure JSON but could not execute on Darwin because the CI runner's Linux colon-separated rpath flags are not valid Mach-O rpaths. The repository's existing engine/plan race paths already use the samego tool test2jsonexecution contract; no Darwin result is claimed here.Review
Independent GPT-6 medium performed four review rounds. It found and drove fixes for external timeout/output drain, JSON pollution, preflight metadata completeness, Makefile default propagation, leader/descendant cleanup ordering, both PID publication races, outer/helper cancellation-budget ordering, and one rebase residue. Final review of commit
d5c0890e41: no remaining P1/P2; safe to push.CI is not being waited on, per request.