Skip to content

Add concurrency and cancellation safety tests for repository cloning #106

Description

@coderabbitai

Background

The repository-cloning implementation in src/engine/connection/repository_clone/mod.rs uses a synchronous Tokio runtime handle (tokio::runtime::Handle) to drive async container exec calls. The test suite does not exercise concurrent clone invocations, multi-threaded runtime scenarios, nested runtime contexts, or cancellation under interleaving.

Required action

Add tests covering:

  1. Concurrent clone calls on the same container (verify no shared-state corruption).
  2. A multi-threaded Tokio runtime context (e.g., #[tokio::test(flavor = "multi_thread")]).
  3. Nested runtime contexts (block_on called from within an async context).
  4. Cancellation: a future dropped before completion does not leave the mock exec client in an inconsistent state.

Document any single-threaded-per-request guarantee directly in code if one exists.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions