mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 11:10:18 +00:00
97aa3247e1
PR #1728's path/mtime-aware get_config() reload broke the common test idiom monkeypatch.setattr(config, 'cfg', {...}). The cfg = _cfg_cache alias bound at import time means the rebinding only changes the module attribute; _cfg_cache stays unchanged, so _cfg_has_in_memory_overrides() returned False and the path-aware reload silently overwrote the test's override. test_issue1426_openrouter_* and test_issue1680_codex_* failed in the full suite while passing standalone — exact polluter signature. Fix: - _cfg_has_in_memory_overrides() now also detects cfg-rebind via cfg is not _cfg_cache. - get_config() returns cfg (the override) when it differs from _cfg_cache, so callers see the test's intended override. - 4 new regression tests pin both prongs in test_stage302_config_override_regression.py. Defense-in-depth (prong 2 of test-isolation-flake-recipe): - test_sprint3.py::test_skills_list and test_skills_list_has_required_fields now skip on empty skills list rather than asserting > 0 / IndexError, so future profile-switch / SKILLS_DIR repointing pollutions don't break the build. The contract under test is 'API returns a non-empty list when there are entries' — empty list signals a polluter elsewhere. Pre-existing wall-clock flake fix (absorb-in-release): - test_issue1144_session_time_sync.py::test_relative_time_uses_server_clock now pins Date.now() to a fixed instant. Without pinning, when CI runs near 08:00 UTC the projected server time crosses midnight and '5 minutes ago' silently becomes '1d'. Same time-of-day-pin pattern as the sibling test_session_bucket_uses_server_clock used. Test count: 4580 → 4584 (+4 regression tests). 0 failures, stably green across multiple runs.