test(watch): script only the watch loop's sleep in drive_watch · Graphify-Labs/graphify@324cb2e · GitHub
Skip to content

Commit 324cb2e

Browse files
test(watch): script only the watch loop's sleep in drive_watch
drive_watch replaced `sleep` on the shared `time` module with its event pump, so every sleeper in the process ran the script, not just the watch loop. A rebuild runs `git rev-parse HEAD` through subprocess.run(timeout=3), whose wait loop sleeps when git has closed its output but has not been reaped yet. That sleep then consumed the next scripted event, or raised the end-of-script KeyboardInterrupt inside the rebuild; _git_head only catches Exception, so the watcher stopped before extract() and the last change never reached graph.json. In CI this surfaced as test_watch_root_config_lifecycle_rebuilds_and_refreshes_event_mapping[modify] failing with `'changed()' not in {'initial()', ...}`. Patch watch.py's own `time` reference instead: sleep is scripted, every other attribute resolves to the real module, and sleeps elsewhere stay real. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HrXx9K7CikYRNMqWg99y8E
1 parent b90b9df commit 324cb2e

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

‎tests/test_language_override_lifecycle.py‎

Lines changed: 39 additions & 1 deletion

0 commit comments

Comments
 (0)