test(e2e): 340 只数它自己那个目录里的 ninja - #557
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
谓词对、对象错:
count_ninja数的是整台机器上的 ninja。事先取的基线只能覆盖「本来就在跑的」,覆盖不了「窗口期间新出现的」。实测于生态沙箱(它与宿主共享 PID 命名空间):另一个会话在完全不相干的工程里跑的 ninja,让一个已经带有修复的构建判成失败。
现在按进程的工作目录限定到测试自己的
$work子树。并已确认限定没有削弱它:对已发布的 2026.9.4.2 仍然变红,并指名孤儿及其目录。