Skip to content

test(e2e): 340 只数它自己那个目录里的 ninja - #557

Merged
Sunrisepeak merged 1 commit into
mainfrom
test/orphan-scope
Sep 4, 2026
Merged

test(e2e): 340 只数它自己那个目录里的 ninja#557
Sunrisepeak merged 1 commit into
mainfrom
test/orphan-scope

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

谓词对、对象错:count_ninja 数的是整台机器上的 ninja。事先取的基线只能覆盖「本来就在跑的」,覆盖不了「窗口期间新出现的」。

实测于生态沙箱(它与宿主共享 PID 命名空间):另一个会话在完全不相干的工程里跑的 ninja,让一个已经带有修复的构建判成失败。

现在按进程的工作目录限定到测试自己的 $work 子树。并已确认限定没有削弱它:对已发布的 2026.9.4.2 仍然变红,并指名孤儿及其目录。

THE PREDICATE WAS RIGHT AND THE OBJECT WAS WRONG.

`count_ninja` counted every ninja on the machine. A baseline taken before the
build covers one that was ALREADY running; it does not cover one that appears
during the window, and a build server, a second checkout or a parallel test can
start one at any moment.

Measured in an ecosystem sandbox, which shares the host's PID namespace: an
unrelated session's ninja, in a different project entirely, made this assertion
fail on a build that has the fix.

Counting is now scoped by the process's working directory to the test's own
`$work` tree. Verified that scoping did not weaken it: the test still FAILS
against the released 2026.9.4.2, naming the orphan and its directory.
@Sunrisepeak
Sunrisepeak merged commit d18cd8b into main Sep 4, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants