mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-16 14:32:34 +00:00
* test: deflake CI and dev-machine flaky tests in bulk Fixes ten distinct flake sources found by mining recent CI failures and running the full suite on a dev machine with real user state: CI-observed races: - tests/conftest.py live-system guard: allow signal 0 (pure liveness probe) through _guarded_kill/_guarded_killpg. psutil.pid_exists() probes a just-killed grandchild reparented to init; the subtree check fails for it and the guard RuntimeError'd test_entire_tree_is_sigkilled_not_just_parent intermittently on unrelated PRs. Hermeticity flakes (fail on dev machines with real state, pass on CI): - agent/coding_context.py: _marker_root() now skips the shared temp root (tempfile.gettempdir()) like it skips $HOME — a stray /tmp/package.json flipped every tmp_path test into the coding posture (9 failures in test_coding_context.py). - test_agent_guardrails.py: pin MAX_CONCURRENT_CHILDREN=3 via autouse monkeypatch instead of freezing the user's real config value at import time (import-time vs call-time config mismatch). - test_web_tools_config.py: TestCheckWebApiKey now neutralizes the ddgs package probe and registry providers — the optional ddgs package in a dev venv lit up the fallback backend. - test_credential_pool.py: block claude_code/hermes-oauth credential autodiscovery in the two pool-merge tests that assert exact id lists (a real ~/.claude/.credentials.json seeded an extra entry). - test_modal_sandbox_fixes.py: clear _permanent_approved / _session_approved — the user's real command_allowlist silently approved the guard-escalation commands under test. - test_setup_irc.py: stub prompt_checklist to select only the IRC row; the non-TTY cancel fallback re-ran the real configured platforms' interactive setup_fn, which hit input() under captured stdin. - test_doctor.py: TestGitHubTokenCheck now patches the module-level HERMES_HOME constant (the file's established pattern) instead of only setenv — doctor was running PRAGMA integrity_check against the real multi-GB state.db and blowing the 300s per-file budget. Latent atexit-duplication (same _enter_buffered_busy class as #34217): - test_undo_command.py: drop importlib.reload(tui_gateway.server) in fixture teardown; reload re-registers the module's atexit hooks. - test_session_platform_resolution.py: drop per-test reload of tui_gateway.server; every resolver reads env at call time. * test: sentinel model value in ignore-user-config fallback assertion With HERMES_IGNORE_USER_CONFIG=1, load_cli_config() falls back to the repo-root cli-config.yaml (untracked, gitignored). On a dev machine that file can legitimately set the same popular model the test hardcoded (anthropic/claude-sonnet-4.6), flipping the != assertion locally while CI (no cli-config.yaml) stayed green. Use an impossible sentinel model name instead. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_billing_rpc.py | ||
| test_compaction_status.py | ||
| test_custom_provider_session_persistence.py | ||
| test_delegation_session_lifecycle.py | ||
| test_entry_sys_path.py | ||
| test_finalize_session_persist.py | ||
| test_gateway_owned_session_reap.py | ||
| test_goal_command.py | ||
| test_inline_rpc_gil_starvation.py | ||
| test_make_agent_provider.py | ||
| test_mcp_late_refresh_thread_owner.py | ||
| test_moa_reference_emit.py | ||
| test_model_switch_marker_role.py | ||
| test_pet_generate_rpc.py | ||
| test_project_tree.py | ||
| test_projects_rpc.py | ||
| test_protocol.py | ||
| test_reasoning_session_scope.py | ||
| test_render.py | ||
| test_review_summary_callback.py | ||
| test_session_platform_resolution.py | ||
| test_slash_worker_ansi.py | ||
| test_slash_worker_profile_home.py | ||
| test_slash_worker_sys_path.py | ||
| test_subagent_child_mirror.py | ||
| test_undo_command.py | ||
| test_wait_for_mcp_discovery.py | ||