hermes-agent/tests/docker
Ben cd5b2c4123
test(docker): poll for boot-log signal instead of fixed sleeps
PR #30136 review item O6: test_container_restart.py used fixed
`time.sleep(8)` calls after `docker restart` to wait for the
cont-init reconciler to finish. Fixed sleeps are slow when the
event happens fast and false-fail when the event happens slow.

Replace with two polling helpers:

* `_wait_for_path(container, path, kind='f' | 'd', deadline_s=...)`
  — generic `test -f/-d` poller. Returns True on success, False on
  timeout; callers assert with a clear message.
* `_wait_for_reconcile_log_mention(container, profile, ...)` — the
  reconciler's per-profile log line is the canonical signal that
  the cont-init reconcile has finished for that profile. Poll on
  it instead of a sleep that hopes 8 seconds is enough.

The fixture-level setup wait is similarly migrated: it now polls
for `profile=default` in the boot log (every container always
gets a default-slot entry per item I1) and raises a clear timeout
error from the fixture if the container never finishes cont-init —
much better diagnostics than a mid-test KeyError.

The remaining `time.sleep()` calls are all internal interval_s
between probe attempts; no fixed wait points left.
2026-05-24 18:05:33 -07:00
..
__init__.py test(docker): add conftest fixtures for docker harness 2026-05-24 18:05:14 -07:00
conftest.py fix(service_manager): s6 detection works for unprivileged hermes user 2026-05-24 18:05:33 -07:00
test_container_restart.py test(docker): poll for boot-log signal instead of fixed sleeps 2026-05-24 18:05:33 -07:00
test_dashboard.py fix(docker): dashboard slot stays 'down' when HERMES_DASHBOARD unset 2026-05-24 18:05:33 -07:00
test_main_invocation.py test(docker): lock baseline behavior for Phase 0 harness 2026-05-24 18:05:14 -07:00
test_profile_gateway.py fix(service_manager): s6 detection works for unprivileged hermes user 2026-05-24 18:05:33 -07:00
test_s6_profile_gateway_integration.py fix(service_manager): rip out dead port parameter 2026-05-24 18:05:33 -07:00
test_tui_passthrough.py test(docker): lock baseline behavior for Phase 0 harness 2026-05-24 18:05:14 -07:00
test_zombie_reaping.py fix(service_manager): s6 detection works for unprivileged hermes user 2026-05-24 18:05:33 -07:00