Skip to content

fix(test): publish shell owner readiness markers atomically - #6135

Merged
Astro-Han merged 1 commit into
apache:mainfrom
YayoiNanoka:fix/shell-owner-readiness
Oct 19, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
YayoiNanoka:fix/shell-owner-readiness

Conversation

@YayoiNanoka

Copy link
Copy Markdown
Contributor

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

  • Built @maka/core, @maka/storage, and @maka/runtime successfully.
  • Passed the complete shell-owner-death.test.js suite three consecutive times on macOS: 6 tests per run, 18 executions, no failures or skips.
  • Passed runtime typecheck and lint/format checks for the changed file.
  • Passed the staged ASF header, protocol epoch, and whitespace checks.
  • Windows execution is left to CI. The original race is timing-dependent; this change does not add a deterministic fault-injection test.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex extracted the existing fixture fix, ran validation, and prepared this PR. The commit retains its Generated-by: OpenAI Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

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?

  • Yes — described under Summary above
  • No
点击展开中文

Shell owner-death 测试的就绪标记先创建文件、再写入 JSON,轮询可能读到空文件并提前解析失败。此修复让两个测试 fixture 先把完整 JSON 写入临时文件,再通过重命名发布标记,保留原有的进程回收和延迟写入断言,不改变生产代码。

该修复从 #6091 拆出,单独审查。

验证:core、storage、runtime 构建成功;完整 owner-death 测试连续三轮通过,每轮 6 项,共 18 次执行,无失败或跳过;runtime 类型检查、变更文件 lint/格式检查,以及提交时的许可证、协议版本和空白检查通过。Windows 由 CI 验证。原竞态依赖调度时机,本次没有增加确定性的故障注入测试。

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
@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Oct 17, 2026
YayoiNanoka added a commit to YayoiNanoka/maka-agent that referenced this pull request Oct 17, 2026
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 Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. CI test passes, 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.

@Astro-Han

Copy link
Copy Markdown
Contributor

Thanks for the contribution and for addressing the review feedback. Merging now.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at @Astro-Han's explicit request: no blocking findings in the automated review of this head, and CI is green.

@Astro-Han
Astro-Han merged commit 521f848 into apache:main Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants