Skip to content

Remove wall-clock sleep from insert_waits_for_mutex test #161

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions