Files
SeedPass/reports/test-audit/test-integrity-note-2026-03-01.yml
google-labs-jules[bot]andPR0M3TH3AN e1400f32a5 refactor: improve test determinism by removing time.sleep
Replaced non-deterministic `time.sleep` calls with active polling loops or
thread joins in `src/tests/` to improve test determinism and reliability.
Modified `test_unlock_sync.py`, `test_nostr_sdk_workflow.py`,
`test_background_relay_check.py`, `test_offline_mode_behavior.py`, and
`test_nostr_index_size.py`.
Generated integrity and audit reports in `reports/test-audit/`.
Completed the scheduler rotation by publishing completion logic and
task log file to `torch/task-logs/daily/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-03-01 02:59:43 +00:00

25 lines
1.2 KiB
YAML

# Test Integrity Note
date: 2026-03-01
agent: test-audit-agent
changes:
- file: src/tests/test_unlock_sync.py
type: refactor
reason: Removed non-deterministic time.sleep(0.05) to await task completion
details: Replaced time.sleep with pm._sync_task.join(timeout=1.0)
- file: src/tests/test_nostr_sdk_workflow.py
type: refactor
reason: Removed non-deterministic time.sleep(0.5) waiting for relay to start
details: Replaced time.sleep with an active polling connection retry loop
- file: src/tests/test_background_relay_check.py
type: refactor
reason: Removed non-deterministic time.sleep(0.05) waiting for background thread
details: Replaced time.sleep with pm._relay_thread.join(timeout=1.0)
- file: src/tests/test_offline_mode_behavior.py
type: refactor
reason: Removed useless time.sleep(0.05)
details: Background thread is never spawned because of early exit, so removed sleep entirely
- file: src/tests/test_nostr_index_size.py
type: refactor
reason: Removed non-deterministic time.sleep(delay) and added missing assertion
details: Replaced time.sleep with an active polling asyncio retry loop and added assert len(results) > 0 at the end of the file.