Commit 67e6cf7
committed
test: stop caching the e2e verdict, whose inputs are not fully declared
The e2e target runs unsandboxed, so Node resolves packages through runfiles
symlinks into the shared bazel-bin tree and can read files that are not declared
inputs. Bazel was memoising the verdict as though the inputs were complete: a
result influenced by ambient output-tree state could be reused indefinitely.
Tag the target external, which forces unconditional execution.
Note that 'no-cache' does NOT do this, which is worth recording because it is
the obvious-looking choice. Bazel has two distinct layers: action-output
caching, which no-cache governs, and test-result caching, which produces the
'(cached) PASSED' annotation and is governed by --cache_test_results and the
external tag. Measured: with +no-cache the second run still reported
'(cached) PASSED'. So did +external injected via --modify_execution_info,
because tags like external are resolved at analysis time and never consult
execution info -- injecting an execution requirement is not equivalent to
setting a tag.
Verified: three consecutive runs of the e2e target all execute, while unit and
typecheck stay cached, so the change is scoped to the one unsound target.
Costs 3.5s per invocation. //:site remains byte-identical.
This is a mitigation, not a fix. It removes the memoisation hazard; it does not
make the inputs complete. Staging specs into TEST_TMPDIR so the sandbox can be
re-enabled is the next step, and the tag should stay until Node no longer
canonicalises package symlinks out of the sandbox.1 parent f9d2264 commit 67e6cf7
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
| |||
0 commit comments