Skip to content

Remove flaky sleep-based synchronisation in mutex concurrency test #168

Description

@coderabbitai

Summary

The new mutex test (`insert_waits_for_mutex`) still uses `thread::sleep(50ms)` and `AtomicBool`, so the interleaving check can flake under load; no barrier/channel sync is used.

Required changes

Replace the sleep with a channel or barrier, assert the spawned thread has started, and keep the single-writer locking model explicit in docs/tests.

Affected areas

  • `chutoro-core/src/hnsw/cpu/unit_tests.rs`

Acceptance criteria

  • Test uses deterministic synchronisation instead of sleep.
  • Single-writer locking model is documented alongside the test.

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