Repository navigation
fix(test): publish shell owner readiness markers atomically - #6135
Conversation
Write complete JSON to a temporary marker and rename it before readiness polling can observe it. This removes the empty-file race that failed CI without weakening the owner-death assertions. Generated-by: OpenAI Codex
Remove weekly controls, aggregation, copy, and tests while retaining local-day Token intensity and request details. Move the independent reliability repairs to apache#6134, apache#6135, and apache#6136; restore the perf scripts and remove repository screenshots while keeping their existing PR links. Generated-by: OpenAI Codex
Astro-Han
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.Reviewed
39e20fb4c4c0553885cadbe238f82001c29e9846(one test file, +4/-2). I found no P0–P2 issue. CItestpasses, and the PR is mergeable.
Both writer scripts in shell-owner-death.test.ts now write their readiness marker to <marker>.tmp and renameSync it into place. A rename within the same directory is atomic on POSIX filesystems, so the owner's readiness poll can only see the missing file or the complete JSON. Before, it could see an empty file that writeFileSync had just created. The rest of the test is unchanged, and no production code is touched. This is the commit split out of #6091 as requested there.
|
Thanks for the contribution and for addressing the review feedback. Merging now. |
Astro-Han
left a comment
There was a problem hiding this comment.
Approved at @Astro-Han's explicit request: no blocking findings in the automated review of this head, and CI is green.
Summary
The shell owner-death tests can read an empty readiness marker between file creation and the first JSON write, causing a JSON parse failure before they exercise owner death. Write the complete marker to a temporary file and rename it into place in both test fixtures. The existing process termination and delayed-write assertions remain unchanged; production behavior is unchanged.
Extracted from #6091 so the unrelated CI reliability fix can be reviewed independently.
Verification
@maka/core,@maka/storage, and@maka/runtimesuccessfully.shell-owner-death.test.jssuite three consecutive times on macOS: 6 tests per run, 18 executions, no failures or skips.AI use
Tool(s) and scope: OpenAI Codex extracted the existing fixture fix, ran validation, and prepared this PR. The commit retains its
Generated-by: OpenAI Codextrailer.Checklist
The existing owner-death suite covers both marker producers; reproducing the pre-fix empty-file race depends on scheduling.
Does this PR entail a change in behavior?
点击展开中文
Shell owner-death 测试的就绪标记先创建文件、再写入 JSON,轮询可能读到空文件并提前解析失败。此修复让两个测试 fixture 先把完整 JSON 写入临时文件,再通过重命名发布标记,保留原有的进程回收和延迟写入断言,不改变生产代码。
该修复从 #6091 拆出,单独审查。
验证:core、storage、runtime 构建成功;完整 owner-death 测试连续三轮通过,每轮 6 项,共 18 次执行,无失败或跳过;runtime 类型检查、变更文件 lint/格式检查,以及提交时的许可证、协议版本和空白检查通过。Windows 由 CI 验证。原竞态依赖调度时机,本次没有增加确定性的故障注入测试。