Summary
`insert_waits_for_mutex` (in `chutoro-core/src/hnsw/cpu/unit_tests.rs`) still uses `thread::sleep(50ms)`, so the test depends on wall-clock timing instead of explicit synchronisation, risking flakiness under load.
Required changes
Replace the sleep with a channel or barrier so the spawned thread signals that it has started before assertions run, keeping the mutex-blocking test timing-free.
Affected areas
- `chutoro-core/src/hnsw/cpu/unit_tests.rs`
Acceptance criteria
- Test no longer relies on `thread::sleep`.
- Test remains deterministic under load/CI.
References
- PR: $pr_url
- Requested by: @$assignee
Summary
`insert_waits_for_mutex` (in `chutoro-core/src/hnsw/cpu/unit_tests.rs`) still uses `thread::sleep(50ms)`, so the test depends on wall-clock timing instead of explicit synchronisation, risking flakiness under load.
Required changes
Replace the sleep with a channel or barrier so the spawned thread signals that it has started before assertions run, keeping the mutex-blocking test timing-free.
Affected areas
Acceptance criteria
References