Files
langgraph/libs
Quanzheng LongandCursor 24716a2f94 test(langgraph): de-flake heartbeat progress test
`_TimedAttemptScope.__init__` sets `_last_progress = time.monotonic()`, but
the watchdog doesn't actually start polling until after `wrap_config` and
task scheduling. Under heavy CI load that gap can grow large enough to
consume the entire idle window before the task body's first await runs —
the watchdog then fires immediately with `elapsed: 0.000s`, since elapsed
is measured from the post-scheduling `start` rather than from scope init.

Two test-side defenses (no production change):
- Bump idle_timeout from 0.2s to 1.0s so scheduling slack stays well within it.
- Call `runtime.heartbeat()` at task-body entry before the first sleep, which
  resets `_last_progress` to "now" the moment the task actually starts.

Confirmed stable: 10/10 local repeated runs pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 09:50:58 -07:00
..
2026-05-05 10:47:08 -07:00