test: stop seven tests from depending on ZFS timestamps and the caller's environment #853
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 503 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #853"
general
weight: 0.35
jbellis
Seven tests failed, several of them most of the time, when the suite ran on ZFS, with
NO_COLORset, or withCARGO_TARGET_DIRset. None of them found a product problem. Each one assumed something about the machine it ran on. This PR changes only those tests, so the suite gives the same result on these setups.ZFS stamps files from a 1 ms tick and, unlike tmpfs or ext4 on recent kernels, does not hand out fine-grained times after a timestamp has been read. A file rewritten microseconds after it was captured can therefore keep the same length, mtime, ctime and inode.
| Test | Cause | Failure rate before | After |
|---|---|---|---|
|
mbx-cache-rustcdep_info::tests::a_disguised_rewrite_is_not_answered_from_the_ledger| rewrite in the same ZFS tick | 48/50 on ZFS (0/50 on tmpfs) | 0/50 ||
mbx-cache-rustcdep_info::tests::precompile_snapshot_does_not_depend_on_the_host_clock| same | 30/50 on ZFS | 0/50 ||
mbx-cache-ccdepfile::tests::precompile_snapshot_does_not_depend_on_the_host_clock| same | 34/50 on ZFS | 0/50 ||
materialize::materialization_tests::a_filesystem_without_clones_links_the_object_instead_of_copying_it| restore and creation in the same ZFS tick | 37/50 on ZFS | 0/50 ||
util::tests::measures_the_disk_holding_a_path| a ZFS pool's capacity can change between two readings under load | 1 of 6 full-suite runs | 0/50 ||
cli::pretty::tests::mascot_keeps_progress_readable_and_leaves_successful_builds| looked for an ANSI escape thatNO_COLOR=1suppresses | 50/50 withNO_COLOR=1| 0/50 ||
build::standalone_adopt_refuses_a_busy_target| inheritedCARGO_TARGET_DIR, sombx adoptskipped before checking the lease | fails whenever it is set | passes |Changes:
a_disguised_rewrite_is_not_answered_from_the_ledgeralready did. 20 ms matchesFINE_TIMESTAMP_RACE_WINDOWinmbx-cache-core. Their assertions are unchanged.CARGO_TARGET_DIRfrom bothmbx adoptcommands.Validation, on Linux 7.0 / 96 cores, with
/tmpon ZFS and other builds loading the host: each of the seven tests passed 50 of 50 runs, and the mascot and adopt tests also pass withNO_COLOR=1and withCARGO_TARGET_DIRset.cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningspass. In two fullcargo nextest run --workspaceruns, the seven passed. The failures in those runs were in tests this PR does not touch and came from the test environment: one test fails whenRUSTCis set, and two failed once under heavy load and passed in the second run. Not checked: macOS and Windows locally (left to CI).The two precompile-snapshot fixtures also pointed at a real gap in the pre-compile check on coarse-timestamp filesystems. The wait fixes the fixtures' assumption, not that gap. It is reported separately in jbellis/mr-boxington#39.
AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.306.
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Tests
Improved reliability of filesystem-related checks on systems with coarse timestamp resolution and fluctuating capacity measurements by allowing timestamp updates to register and retrying capacity comparisons.
Made build adoption tests independent of inherited target-directory settings, so they consistently check lease behavior.
Updated terminal output checks to verify rendered foreground and background colors directly, while continuing to check when the mascot appears.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->