Skip to content

Commit dc5649d

Browse files
committed
test: re-stamp the Windows build-dir DACL at the serial-tail boundary
On one dry run the two arm shards split: the shard whose serial tail held the install-flow suites failed the source-directory policy minutes after its pre-wave stamp, while its sibling — same runner image, same stamp — passed with no install-flow suites to notice. Wave suites spawn Cygwin-family tooling that can rewrite the build directory's DACL behind the first stamp, so the stamp is now a function invoked both pre-wave and at the tail boundary, where the deadline-sensitive suites that depend on it actually run. Both invocations self-verify out loud. Verified on the VM from a deliberately reset (inherited) build directory through the real --par path: both stamps report clean, mini shard green. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent acce9a4 commit dc5649d

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

‎scripts/run-tests-parallel.sh‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,32 @@ mkdir -p "$LOGDIR"
4848
# setup. Two idempotent steps: protect the DIRECTORY (inheritance flags are
4949
# directory-only — a /T re-root leaves files with empty deny-all DACLs),
5050
# then /reset the children to re-inherit the clean set.
51-
case "$(uname -s 2>/dev/null)" in
52-
MINGW* | MSYS*)
51+
stamp_windows_build_dir() {
52+
local when="$1"
53+
case "$(uname -s 2>/dev/null)" in
54+
MINGW* | MSYS*) ;;
55+
*) return 0 ;;
56+
esac
57+
local runner_dir_w me stamp_out reset_out
5358
runner_dir_w="$(cygpath -w "$(dirname "$RUNNER")")"
5459
me="$(whoami | tr -d '\r')"
5560
stamp_out=$(MSYS2_ARG_CONV_EXCL='*' icacls "$runner_dir_w" /inheritance:r \
5661
/grant:r "${me}:(OI)(CI)F" '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' \
57-
/Q 2>&1) || echo "WARN: build-dir DACL stamp failed (user=$me dir=$runner_dir_w): $stamp_out"
62+
/Q 2>&1) || echo "WARN: build-dir DACL stamp ($when) failed (user=$me dir=$runner_dir_w): $stamp_out"
5863
reset_out=$(MSYS2_ARG_CONV_EXCL='*' icacls "${runner_dir_w}\\*" /reset /T /C /Q 2>&1) ||
59-
echo "WARN: build-dir child DACL reset failed: $(printf '%s' "$reset_out" | tail -2)"
64+
echo "WARN: build-dir child DACL reset ($when) failed: $(printf '%s' "$reset_out" | tail -2)"
6065
# The stamp is load-bearing for the install-flow suites: verify it and say
6166
# so, in either direction — a silent stamp once cost a full CI round to
6267
# even see WHETHER it had run.
6368
if MSYS2_ARG_CONV_EXCL='*' icacls "$runner_dir_w" 2>/dev/null |
6469
grep -qE 'Authenticated Users|CREATOR OWNER'; then
65-
echo "WARN: build-dir DACL still grants cross-account mutation after stamp:"
70+
echo "WARN: build-dir DACL still grants cross-account mutation after $when stamp:"
6671
MSYS2_ARG_CONV_EXCL='*' icacls "$runner_dir_w" 2>&1 | head -8
6772
else
68-
echo "build-dir DACL stamped clean ($runner_dir_w, user=$me)"
73+
echo "build-dir DACL stamped clean ($when, $runner_dir_w, user=$me)"
6974
fi
70-
;;
71-
esac
75+
}
76+
stamp_windows_build_dir pre-wave
7277

7378
SUITES_FILE="$LOGDIR/suites.txt"
7479
RESULTS_FILE="$LOGDIR/results.txt"
@@ -243,6 +248,13 @@ while IFS= read -r sname; do
243248
echo "$sname" >> "$FLEX_FILE"
244249
fi
245250
done < "$SER_FILE"
251+
# Wave suites spawn Cygwin-family tooling that can rewrite the build
252+
# directory's DACL behind the first stamp (observed: an arm shard whose
253+
# tail held the install-flow suites failed the source-directory policy
254+
# minutes after a clean pre-wave stamp, while its sibling shard passed).
255+
# Re-stamp at the tail boundary so the deadline-sensitive tail — which
256+
# hosts those suites — always starts from the verified-clean shape.
257+
stamp_windows_build_dir pre-tail
246258
xargs -P "${CBM_TAIL_JOBS:-2}" -I{} bash -c 'run_one "$@"' _ {} < "$FLEX_FILE"
247259
while IFS= read -r sname; do
248260
run_one "$sname"

0 commit comments

Comments
 (0)