Skip to content

Commit 0f84867

Browse files
committed
test(e2e): give 317 the window its bound needs, and run 602 where the report exists
Reaching "five consecutive short failures" costs at least 1.25 s (four restart delays of 250 ms and five 50 ms polls). A two-second pause left 150 ms per spawn, and a loaded macOS runner exceeded it twice in a row on main while the same code passed twice on this branch. The pause is now five seconds, so the property is decided by the code. 602 declared no platform, and on Windows the doctor does not emit the device-toolkit section at all: the payloads are Linux builds and the bound a Windows toolkit states is an _MSC_VER range the report does not read. It also ran the doctor in a fresh home, which provisioned a full toolchain into the temporary directory: 229 s and 1.4 GB per run. It now requires unix-shell and runs under MCPP_OFFLINE.
1 parent d5a933c commit 0f84867

2 files changed

Lines changed: 45 additions & 3 deletions

File tree

‎tests/e2e/317_project_build_hooks.sh‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ esac
182182
if [[ $HOST_WINDOWS -eq 1 ]]; then
183183
slow_command="ping -n 6 127.0.0.1 >NUL"
184184
pause_2s="ping -n 3 127.0.0.1 >NUL"
185+
pause_5s="ping -n 6 127.0.0.1 >NUL"
185186
else
186187
slow_command="sleep 5"
187188
pause_2s="sleep 2"
189+
pause_5s="sleep 5"
188190
fi
189191
write_manifest <<EOF
190192
[package]
@@ -360,13 +362,22 @@ once=$(wc -l < runs.log | tr -d ' ')
360362
#
361363
# `loop` on a typo is a fork bomb otherwise. The bound is five consecutive
362364
# runs that end unsuccessfully within a second.
365+
#
366+
# The build must stay open long enough for the supervisor to reach that bound.
367+
# Reaching it costs five spawns, four restart delays of 250ms, and up to 50ms
368+
# of poll granularity after each exit: 1.25s before a single spawn is counted.
369+
# Under a two-second pause that left 150ms per spawn, and a loaded macOS
370+
# runner exceeded it (main, 2026-09-05: the build finished, the warning was
371+
# never printed, and the test reported the bound as missing). Five seconds
372+
# leaves 750ms per spawn; the property is then decided by the code and not by
373+
# the runner's load.
363374
write_manifest <<EOF
364375
[package]
365376
name = "hookprobe"
366377
version = "0.1.0"
367378
368379
[hooks]
369-
build_start = "$pause_2s"
380+
build_start = "$pause_5s"
370381
during_build = { cmd = "mcpp-hook-command-that-does-not-exist", loop = true }
371382
EOF
372383
# The build still succeeds — an experimental hook has no vote — but giving up

‎tests/e2e/602_device_toolkit_payload_first.sh‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/env bash
2+
# requires: unix-shell
23
# The device-toolkit report reads a PAYLOAD before it reads the host.
34
#
5+
# POSIX hosts only: the report is produced there and nowhere else. On Windows
6+
# the doctor does not emit the section at all -- the toolkit payloads in the
7+
# index are Linux builds, and the host-compiler bound a Windows toolkit states
8+
# is an `_MSC_VER` range the report does not yet read. Running this fixture
9+
# there asserts on a section that cannot appear (measured on the Windows
10+
# runner, 2026-09-05).
11+
#
412
# A toolkit installed through xlings is the one a build will use, and it is
513
# also the newer one -- measured on the development machine, a payload states
614
# `gcc <= 15` where the distribution's CUDA 12.0 states `gcc <= 12`. Reporting
@@ -19,14 +27,36 @@ trap "rm -rf $TMP" EXIT
1927
# bound is one nothing on a real machine would state.
2028
PAYLOAD="$TMP/xlings/data/xpkgs/local-x-cuda-crt/99.9.99/include/crt"
2129
mkdir -p "$PAYLOAD"
30+
# ⚠️ BOTH GUARDS, AND THAT IS NOT BELT-AND-BRACES. The report names the bound
31+
# for the family of the compiler mcpp resolved, and that family differs by
32+
# platform: gcc on the Linux runners, clang on the macOS one. A fixture stating
33+
# only the GNU guard reported `clang N <= 0` there — a criterion decided by the
34+
# environment rather than by the code under test. Stating both makes the
35+
# reading 41 whichever family answers.
2236
cat > "$PAYLOAD/host_config.h" <<'HDR'
2337
#if __GNUC__ > 41
2438
#error -- unsupported GNU version! gcc versions later than 41 are not supported!
2539
#endif
40+
#if defined(__clang__)
41+
#error -- unsupported clang version! clang version must be less than 42 and greater than 3.2 .
42+
#endif
2643
HDR
2744

45+
# ⚠️ BOTH STORES ISOLATED. The report searches mcpp's own store before the
46+
# xlings one, so on a machine that has a real CUDA payload installed the real
47+
# one answers and this fixture is never read — the assertion then measures
48+
# whatever that machine happens to have. Fresh homes make the reading a property
49+
# of the code rather than of the runner.
50+
#
51+
# OFFLINE, because a fresh home is otherwise bootstrapped in full during the
52+
# diagnosis: measured on the development machine, the doctor cloned the index,
53+
# installed ninja and patchelf, and then downloaded glibc and gcc -- 1.4 GB and
54+
# 229 seconds -- before reaching the section under test. Under `MCPP_OFFLINE`
55+
# the bootstrap is skipped and the toolchain is not provisioned; the device
56+
# toolkit section is produced either way, and its reading is what matters here.
2857
out="$TMP/doctor.log"
29-
XLINGS_HOME="$TMP/xlings" "$MCPP" self doctor > "$out" 2>&1 || true
58+
MCPP_HOME="$TMP/mcpp" XLINGS_HOME="$TMP/xlings" MCPP_OFFLINE=1 \
59+
"$MCPP" self doctor > "$out" 2>&1 || true
3060

3161
grep -q "device toolkit" "$out" || { cat "$out"; echo "FAIL: no device toolkit section"; exit 1; }
3262

@@ -42,7 +72,8 @@ echo "PASS: the payload's bound is the one reported"
4272
# The control. Without the payload store, the same command must NOT report 41 --
4373
# otherwise the assertion above would pass against a doctor that hardcodes it.
4474
out2="$TMP/doctor2.log"
45-
XLINGS_HOME="$TMP/empty" "$MCPP" self doctor > "$out2" 2>&1 || true
75+
MCPP_HOME="$TMP/mcpp2" XLINGS_HOME="$TMP/empty" MCPP_OFFLINE=1 \
76+
"$MCPP" self doctor > "$out2" 2>&1 || true
4677
if grep -qE "<= ?41|bound of 41" "$out2"; then
4778
echo "FAIL: 41 is reported with no payload present; the test measures nothing"
4879
exit 1

0 commit comments

Comments
 (0)