test(prune-cache): build scenario 14's aside the way the pass builds one
Review finding on #2. Swapping the settle window's `stat -c %Z` for `%Y` — the exact substitution the comment beside it calls the wrong signal — left the suite green at 37/37. The scenario built its aside with `mkdir`, so the fixture's mtime was also ~now and the two timestamps agreed; a fixture whose clocks agree cannot tell them apart. Every real aside is the opposite shape: a cache last written days ago, renamed a moment ago. Under `%Y` the window would never fire for one, the sweeper would silently return to reclaiming asides another pass is still deciding about, and nothing would say so — the mechanism guarded by a comment again, which is what the previous finding was about. So the fixture is now built the way the pass builds one: an old directory `mv`d into the aside name. `%Z` -> `%Y` now fails scenario 14, as does deleting the guard outright. Also sharpens why the PID alternative was rejected: the `$$` in an aside's name was that pass's PID inside its own job container, so testing it from another one is not unreliable, it is meaningless. No change to prune-cache.sh's behaviour; the assertions are untouched.
This commit is contained in:
@@ -89,9 +89,10 @@ STALE_LOCK_SECONDS="${STALE_LOCK_SECONDS:-7200}"
|
||||
# An aside directory is in flight for one rename plus one marker glob —
|
||||
# milliseconds. Anything older belongs to a pass that died between the two, so
|
||||
# an age is what separates "another pass is mid-eviction" from "a leftover",
|
||||
# and it separates them without having to identify the pass that created it: a
|
||||
# PID is meaningless across the job containers these passes run in, and
|
||||
# recycles. Three orders of magnitude of headroom over the operation it covers,
|
||||
# and it separates them without having to identify the pass that created it.
|
||||
# The `$$` in an aside's name was that pass's PID inside its own job
|
||||
# container, so testing it with `kill -0` from a different one is not
|
||||
# unreliable, it is meaningless — and PIDs recycle besides. Three orders of magnitude of headroom over the operation it covers,
|
||||
# and short enough that a genuine leftover is reclaimed by the next run rather
|
||||
# than lingering while the volume is under pressure.
|
||||
EVICTION_ASIDE_SETTLE_SECONDS="${EVICTION_ASIDE_SETTLE_SECONDS:-60}"
|
||||
|
||||
Reference in New Issue
Block a user