mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-03 07:18:03 +01:00
v1.92.71.0 test(free): end four non-subject waits early and drop a duplicated test block (GSTA-151 D) (#3582)
* test(free): end four non-subject waits early and drop a duplicated test block setup's _wait_with_deadline polls every 0.1 s on the SECONDS clock; pregate-supervise and gstack-detach wait on pids and go-files instead of fixed sleeps; qa-probe-gates loses its duplicated C2 block; context-identity runs one restore. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(setup): mark the sub-second wait bound as the contract (gstack-timing-ok) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): unreleased entry for the free-suite wait pass (GSTA-151 D) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
cd788faec7
commit
69c14b17d5
10 files changed
+50
-54
No files matched your search
@@ -1539,15 +1539,15 @@ _kill_tree() {
|
||||
# poll the PID and SIGKILL the whole probe tree past the deadline. Returns
|
||||
# the probe's exit code, or 124 on timeout.
|
||||
_wait_with_deadline() {
|
||||
local pid="$1" deadline_s="$2" waited=0
|
||||
local pid="$1" deadline_s="$2" end
|
||||
end=$((SECONDS + deadline_s))
|
||||
while kill -0 "$pid" 2>/dev/null; do
|
||||
if [ "$waited" -ge "$deadline_s" ]; then
|
||||
if [ "$SECONDS" -gt "$end" ]; then
|
||||
_kill_tree "$pid"
|
||||
wait "$pid" 2>/dev/null || true
|
||||
return 124
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
sleep 0.1
|
||||
done
|
||||
wait "$pid"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user