Skip to content

Commit 89db17a

Browse files
committed
Gate: treat a full MOTOR as unavailable, and allow an explicit --skip-lane
runner_full after the whole queue wait is the runner's state, not a test result. --skip-lane leaves a lane MOTOR can't run (today the Windows image refuses the confined worker's window station) to the CI run on main, and the summary prints it as SKIP.
1 parent 3bb54aa commit 89db17a

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

‎script/gate.sh‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ usage() {
1414
echo 'Logs: .cortexkit/internal-docs/audits/gate-logs/<run>/. Never pushes.'
1515
echo 'Workers: --print-plan lists runon commands; --prepare-tools stages offline NATS inputs.'
1616
echo 'After runon checks, --clean-tools removes only those transient inputs (cache is retained).'
17-
echo '--allow-unavailable permits only unreachable/draining runners refused before start, never failed tests.'
17+
echo '--allow-unavailable permits only unreachable, draining or full runners refused before start, never failed tests.'
18+
echo '--skip-lane NAME leaves a lane to the CI run on main, printed as SKIP.'
1819
}
1920

2021
run() {
@@ -206,6 +207,7 @@ print_plan=no
206207
prepare_tools=no
207208
clean_tools=no
208209
allow_unavailable=no
210+
skip_lanes=" "
209211
while [[ $# -gt 0 ]]; do
210212
case "$1" in
211213
--workspace) mode=workspace ;;
@@ -214,6 +216,7 @@ while [[ $# -gt 0 ]]; do
214216
--prepare-tools) prepare_tools=yes ;;
215217
--clean-tools) clean_tools=yes ;;
216218
--allow-unavailable) allow_unavailable=yes ;;
219+
--skip-lane) shift; skip_lanes+="${1:?--skip-lane requires a lane name} " ;;
217220
--base) shift; base=${1:?--base requires a Git ref} ;;
218221
--help|-h) usage; exit 0 ;;
219222
*) usage >&2; exit 2 ;;
@@ -350,6 +353,18 @@ else
350353
fi
351354
echo 'SKIP linux-arm64 and native syscall trace: MOTOR has no architecture/image selector' | tee "$logs/linux-arm64.log"
352355
echo 'NOTE Windows uses the configured MOTOR image, not both GitHub hosted images' | tee "$logs/windows-images.log"
356+
# The operator can leave a lane to main's CI when its runner can't run it,
357+
# such as a Windows image that refuses the confined worker's window station.
358+
# The skip is printed in the summary, never silent.
359+
kept=()
360+
for lane in "${lanes[@]}"; do
361+
if [[ $skip_lanes == *" $lane "* ]]; then
362+
echo "SKIP $lane: skipped by --skip-lane; main's CI covers it" | tee "$logs/$lane.log"
363+
else
364+
kept+=("$lane")
365+
fi
366+
done
367+
lanes=("${kept[@]}")
353368
pids=()
354369
for lane in "${lanes[@]}"; do
355370
if [[ $lane != linux ]]; then

‎script/gate_support.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def unavailable_reason(exit_code, output):
162162
for line in output.splitlines():
163163
if line.startswith(prefix):
164164
reason = line[len(prefix):]
165-
if re.match(r"^(unreachable|runner_draining)(?::|\s|$)", reason):
165+
# runner_full: MOTOR's hosts stayed full for the job's whole wait.
166+
if re.match(r"^(unreachable|runner_draining|runner_full)(?::|\s|$)", reason):
166167
return reason
167168
return ""
168169

‎script/tests/gate.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ def test_macos_build_dir_is_unique_even_with_inherited_target_dir(self):
219219
self.assertNotEqual(*directories)
220220

221221
def test_runner_unavailable_requires_refusal_before_lane_start(self):
222-
for reason in ("unreachable: Windows handshake timed out", "runner_draining: retry after 2000 ms"):
222+
for reason in (
223+
"unreachable: Windows handshake timed out",
224+
"runner_draining: retry after 2000 ms",
225+
"runner_full: hosted_capacity (retry after 5000 ms)",
226+
):
223227
output = f"ck motor run: refused before start: {reason}\n"
224228
self.assertEqual(gate.unavailable_reason(200, output), reason)
225229
for status in (0, 1, 101, 201, 202):

0 commit comments

Comments
 (0)