clusterd-test-driver: pin explain renders to un-redacted - #38483
Conversation
QA LLM Review1. MEDIUM -- the new regression test passes with the pin removed
DetailsVerified locally by reverting
The test profile compiles One line gives it teeth, since fn explain_renders_literals_verbatim() {
+ // Emulate the release-profile driver image: soft assertions off, which is what
+ // `ExplainConfig::default()` derives `redacted` from.
+ mz_ore::assert::SOFT_ASSERTIONS.store(false, std::sync::atomic::Ordering::Relaxed);
assert!(!explain_config().redacted);With that added I confirmed the test passes with the pin and fails without it under the default environment. Caveat worth a Incidentally, the render the test exercises is the source-import MFP ( |
`ExplainConfig::default()` derives `redacted` from `mz_ore::assert::soft_assertions_enabled()`, which follows `debug_assertions` unless `MZ_SOFT_ASSERTIONS` overrides it. The `HeadlessDriver` mzcompose service sets no such override and its image is built at mzbuild's release-like profile, so `explain` rendered goldens with literals anonymized to a block character there, while `cargo test` and `run-local.py`'s default `PROFILE=dev` rendered them verbatim. A golden written under one would not match the other, and any plan carrying a literal would assert a redaction instead of the constant. Pinning `redacted: false` makes the render depend only on the plan. No test covers it: every configuration the crate's unit tests run in already has soft assertions on, so an assertion on the rendered text holds with or without the pin, and the only way to make one bite is to flip the process-global `SOFT_ASSERTIONS` atomic from inside the test. Reported by def- on MaterializeInc#37141 and MaterializeInc#38483. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2bf45bd to
e521053
Compare
|
Correct on both counts — the test was toothless in every configuration it actually runs in, and the render it checked was the source-import MFP rather than a Dropped the test rather than giving it teeth: making it bite requires flipping the process-global Posted by Claude Code on behalf of @antiguru |
|
Thanks for the review! |
Follow-up to #37141, addressing def-'s review that landed after the merge.
ExplainConfig::default()derivesredactedfrommz_ore::assert::soft_assertions_enabled(), which followsdebug_assertionsunlessMZ_SOFT_ASSERTIONSoverrides it. TheHeadlessDrivermzcompose service sets no such override and its image is a plaincargo-buildpre-image at mzbuild's release-like profile, soexplainrendered goldens with literals anonymized to a block character there, whilecargo testandrun-local.py's defaultPROFILE=devrendered them verbatim. A golden written under one would not match the other, and any plan carrying a literal would assert a redaction instead of the constant. Nothing differs today becausejoin.spec's plan holds only ids,Arrange/Streamnodes, and column keys.Pinning
redacted: falsemakes the render depend only on the plan and not on how the binary was built. Confirmed by hand: with the pin removed andMZ_SOFT_ASSERTIONS=0, a plan carrying a literal rendersmap=(█).No test covers this. Every configuration the crate's unit tests run in already has soft assertions on, so an assertion on the rendered text holds with or without the pin, and the only way to make one bite is to flip the process-global
SOFT_ASSERTIONSatomic from inside the test.🤖 Generated with Claude Code