hermes-agent/tests/docker
Teknium 0f56e20d23
test: de-flake 30 timing-sensitive test files for loaded CI runners
Root-cause fixes from the flake audit (session-DB mining + repo sweep):

Event-based sync instead of sleep-sync:
- title_generator: mock sets threading.Event, wait(10) replaces
  sleep(0.3) hoping the daemon thread got scheduled
- docker zombie_reaping / profile_gateway: poll-for-state helpers
  replace fixed 1-3s sleeps (s6 transitions + SIGCHLD reaping are async)
- process_registry tree test: select()-bounded readline replaces an
  unbounded blocking read (parent wedge now fails THIS test with a clear
  message instead of an opaque rc=124 file kill); SIGTERM grace 1s->2s
  (the 1s partition window mid-interpreter-startup is how a child PID
  escaped the live-system guard in CI)

Timeout raises (loaded 8-way-sliced runners see ~5s scheduling floors;
all of these complete in ms-to-1s when healthy so the raises cost
nothing on green runs):
- subprocess/thread waits <= 2s raised to 10-15s across mcp_tool,
  mcp_circuit_breaker, mcp_reconnect_retry_reset, mcp_parked_self_probe,
  mcp_cancelled_error_propagation, registry, clarify_gateway, interrupt,
  voice_cli_integration, docker_environment, session_store_lock_io,
  planned_stop_watcher, cli_interrupt_subagent, thread_scoped_output
  (joins now also assert not is_alive() so stragglers fail loudly)
- wall-clock discrimination ceilings loosened where the guarded hang is
  10x larger: local_background_child_hang 4s->10s, interrupt_cleanup
  setup 5s->20s + pgid-exit 30s->60s, mcp_stability grandchild spinup
  5s->15s, protocol/gil-starvation fast-handler 0.5s->2s,
  iso_certify_seam 1.5s->5s, wait_for_mcp_discovery 0.1s->1s
- narrow assertion windows widened: honcho first-turn wait 0.4..0.65 ->
  0.25..2.0 (property is bounded-not-hung, not an exact wall-clock);
  compression fork-lock TTL 1s->3s (12 refresh chances per lease);
  compression-lock expiry margins symmetric (ttl 0.05->0.5, sleep 1.0)
- telegram hung-DNS bound 1.0->1.4 (fake hang is 1.5s — must stay under)
2026-07-17 13:54:04 -07:00
..
__init__.py test(docker): add conftest fixtures for docker harness 2026-05-24 18:05:14 -07:00
conftest.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_config_migration.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_container_restart.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_dashboard.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_docker_exec_privilege_drop.py test(docker): wait for cont-init to finish before privilege-drop shim tests (#54026) 2026-06-28 17:06:26 +10:00
test_dump_build_sha.py change(ci): docker-publish.yml -> docker.yml 2026-06-26 19:15:18 -07:00
test_gateway_bootstrap_state.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_gateway_run_supervised.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_home_override_scripts.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_immutable_install.py fix: remove dead f-string prefixes via ruff F541 (216 sites) (#52336) 2026-07-05 13:42:46 -07:00
test_immutable_install_permissions.py Harden hosted Docker install tree against self-modification (#47490) 2026-06-18 09:09:21 +10:00
test_license_file_present.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_log_dir_seed.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -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 test: de-flake 30 timing-sensitive test files for loaded CI runners 2026-07-17 13:54:04 -07:00
test_puid_pgid_remap.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_s6_profile_gateway_integration.py fix(s6): dot-prefix gateway staging dir so svscan ignores it mid-build (#54834) 2026-06-29 21:33:00 +10:00
test_smoke.py change(ci): migrate docker smoketests to real tests 2026-06-26 19:15:18 -07:00
test_stage2_browser_discovery.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_tini_compat_shim.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_toplevel_chown.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_tui_passthrough.py test(docker): make tty-passthrough probe robust to container boot-log noise (#38665) 2026-06-04 13:19:13 +10:00
test_tui_prebuilt_bundle.py fix(docker): point TUI launcher at prebuilt bundle via HERMES_TUI_DIR (#37923) 2026-06-03 15:30:45 +10:00
test_user_flag_guard.py refactor(ci): rewrite docker tests to check built container 2026-06-26 19:15:18 -07:00
test_zombie_reaping.py test: de-flake 30 timing-sensitive test files for loaded CI runners 2026-07-17 13:54:04 -07:00