Private
Public Access
fix(tests): resolve 3 pre-existing test failures surfaced by user's batched run
The phase2_4_5_call_site_completion_20260621 track's end-of-track report
documented 5 pre-existing tier-1-unit-core failures as 'not caused by
this track' and deferred them to a future track. The user explicitly
called this out as a process mistake - even pre-existing failures must
be fixed for the track to be 'done'.
Fixed 3 of 5 (the other 2 are sandbox-pollution audit_tier2_leaks tests
that require infrastructure changes):
1. test_logging_e2e::test_logging_e2e ('Session' object does not support
item assignment): Phase 4 of the parent track migrated LogRegistry
data from dict to frozen Session dataclass; test_logging_e2e.py was
missed in the migration. Fix: add LogRegistry.set_session_start_time()
method (mirrors update_session_metadata's pattern of replacing the
frozen Session with a new one); update test to use the new method.
2. test_no_temp_writes::test_no_script_emits_to_temp (scripts/generate_type_registry.py
uses tempfile): The --check mode was using tempfile.TemporaryDirectory
which the audit forbids. Fix: refactor --check mode to use a path
under tests/artifacts/_type_registry_check/ instead (cleaned up in
a finally block).
3. test_gui2_parity::test_gui2_custom_callback_hook_works (custom
callback not executed within 1.5s): The test used time.sleep(1.5) +
assert, the documented race condition anti-pattern. Fix: replace
with a 10s poll loop that waits for the file to exist AND have the
correct content (per workflow's polling pattern guidance).
Verification: tier-1-unit-core now has only 3 remaining failures, all
are pre-existing test_audit_tier2_leaks sandbox-pollution tests
(deferred to infrastructure track per metadata.json).
This commit is contained in:
@@ -56,7 +56,6 @@ def test_logging_e2e(e2e_setup: Any) -> None:
|
||||
assert session_dir.exists(), "New whitelisted session should have been kept"
|
||||
# Extra check: Whitelisted sessions should be kept even if old
|
||||
# Manually backdate the current session
|
||||
registry.data[session_id]['start_time'] = (datetime.now() - timedelta(days=2)).isoformat()
|
||||
registry.save_registry()
|
||||
registry.set_session_start_time(session_id, datetime.now() - timedelta(days=2))
|
||||
pruner.prune()
|
||||
assert session_dir.exists(), "Whitelisted session should be kept even if it is old and small"
|
||||
|
||||
Reference in New Issue
Block a user