Skip to content

Commit 3e97d44

Browse files
authored
Merge pull request #646 from Fr-e-d/contrib/sync-1785795776
sync: update 2 file(s) in core/
2 parents 8d3e38d + fce32b4 commit 3e97d44

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.gaai/core/scripts/lib/test-gate.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,18 @@ _test_gate_run_units() {
253253
# 100%+ CPU each, run twice per commit-phase attempt (HEAD + baseline),
254254
# with up to MAX_CONCURRENT deliveries in parallel — background test
255255
# execution otherwise competes evenly with the operator's foreground work
256-
# for CPU scheduling. renice on $$ (this subshell) before spawning the
257-
# test process; child processes inherit the lowered niceness. macOS/Linux
258-
# still grant it idle CPU when nothing else needs it, so total suite
259-
# wall-clock is not meaningfully affected — only scheduling priority
260-
# under contention changes.
261-
(renice -n 15 -p $$ >/dev/null 2>&1; cd "$worktree_path" && eval "$cmd") 2>&1 | tee -a /dev/stderr >/dev/null
256+
# for CPU scheduling. Renice THIS subshell before spawning the test
257+
# process so its children inherit the lowered niceness — must target
258+
# $BASHPID, not $$: inside `( ... )`, $$ still resolves to the PARENT
259+
# shell's PID (bash never rebinds it for subshells), so `renice -p $$`
260+
# relabels a process that already forked this subshell before the call
261+
# ran and has no effect on anything forked from here. Verified: children
262+
# spawned after `renice -p $$` stayed at nice 0; after `renice -p
263+
# $BASHPID` they correctly inherit 15. macOS/Linux still grant idle CPU
264+
# when nothing else needs it, so total suite wall-clock is not
265+
# meaningfully affected — only scheduling priority under contention
266+
# changes.
267+
(renice -n 15 -p $BASHPID >/dev/null 2>&1; cd "$worktree_path" && eval "$cmd") 2>&1 | tee -a /dev/stderr >/dev/null
262268
exit_code=${PIPESTATUS[0]}
263269
echo "[TEST-GATE] unit=${label} type=${type} exit=${exit_code}" >&2
264270

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
## [Unreleased]
1111

1212
### Changed
13+
- fix: renice test-gate subshell via $BASHPID, not $$
1314
- fix: lower CPU priority of test-gate unit runs
1415
- fix: stream test-gate unit output live instead of buffering
1516
- fix: hang-detector was blind to commit-phase activity

0 commit comments

Comments
 (0)