---
name: a-long-foreground-sleep-becomes-a-short-background-one
description: "A Bash `sleep 590` exceeds the tool's foreground timeout and is moved to background at ~120s, so your \"10-minute wait\" is a 2-minute one and you poll 5x more than you think — the tell is a build that looks impossibly slow."
metadata: 
  node_type: memory
  type: feedback
  originSessionId: ce86e2f4-9819-4bde-b3e1-03d891562bf2
  modified: 2026-08-28T23:47:33.971Z
---

`sleep 590` in a Bash call does NOT wait 590s. The harness moves any foreground
command past its timeout (~120s default) to the background and returns
immediately, so the next thing I do is check again — **a 10-minute wait is
really a 2-minute one, and I poll ~5x more often than I intend.**

**Measured 2026-08-28 (CONDUIT W3):** I read the box clock across a run of
`sleep 590` calls and it advanced 16:11 → 16:15 → 16:23 → 16:26 — about 15
minutes of wall clock across what I believed were 8+ waits of ten minutes each.

**The dangerous part is not the wasted turns, it is the FALSE INFERENCE.** I
concluded a `cargo nextest -p spt --all-targets` build had been "compiling for
over an hour" and started hunting for a wedge — a stall, a lock, a hung test
binary — when it had run ~13 minutes and was entirely healthy. A polling storm
manufactures the impression of a hang, and then you go debug the hang.

**Tell:** you are checking the same file repeatedly and it never changes, AND the
elapsed time you believe has passed is wildly out of line with what the work
should cost. Read a real clock (`date`) before concluding anything is stuck.

**Do instead — one notification, no polling:**

- `Monitor` with an until-loop is the right tool: it fires when the condition is
  actually true and stays quiet until then.
  `until grep -q DONE log; do sleep 30; done; cat log`
- Or `Bash` with `run_in_background` on a command that EXITS when the condition
  holds — you get exactly one completion notification.
- The background task you are waiting on already notifies you when it finishes.
  Waiting for that notification is free; polling for it is not.

Kin: [[empty-tasklist-is-not-a-dead-background-task]],
[[background-task-output-not-evidence-until-completion]],
[[a-frontier-names-where-progress-stopped-not-the-cause]] — the same shape of
error, where the place I stopped looking got mistaken for the cause.
