Skip to content

Commit 67e6cf7

Browse files
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

File tree

src/aecdump-viewer/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ playwright_bin.playwright_test(
169169
"PLAYWRIGHT_TEST_DIR": "e2e_tests",
170170
},
171171
tags = [
172+
# This target's inputs are not fully declared: without the sandbox,
173+
# Node resolves packages through runfiles symlinks into the shared
174+
# bazel-bin tree and can read files that are not inputs. Bazel would
175+
# otherwise memoise the verdict as though the inputs were complete, so
176+
# force it to re-run. Note "no-cache" does NOT do this -- it governs
177+
# action-output caching, a different layer from test-result caching.
178+
"external",
172179
# Playwright's test discovery finds nothing inside Bazel's sandbox: it
173180
# does not follow the symlinks the sandbox stages files behind. The
174181
# same target passes outside the sandbox, and upstream's own example

0 commit comments

Comments
 (0)