Skip to content

feat(testing): add async parallel test runner with concurrency + timeout#1601

Open
Mustafa11300 wants to merge 1 commit intomofa-org:mainfrom
Mustafa11300:feat/issue1-async-test-runner-revive
Open

feat(testing): add async parallel test runner with concurrency + timeout#1601
Mustafa11300 wants to merge 1 commit intomofa-org:mainfrom
Mustafa11300:feat/issue1-async-test-runner-revive

Conversation

@Mustafa11300
Copy link
Copy Markdown
Contributor

@Mustafa11300 Mustafa11300 commented Apr 9, 2026

Feat: add async parallel test runner for mofa-testing #1598

Problem

The testing crate did not have a dedicated async test execution engine with configurable parallelism and per-test timeout control.
Tests were primarily run through cargo test, and the existing suite runner in runner.rs executes sequentially without configurable concurrency, timeout enforcement, or progress event emission.

Fix

Implemented a new async runner foundation in runner.rs, and exported it from lib.rs.

Key additions:

  • AsyncTestRunner with configurable bounded concurrency
  • Semaphore-based parallel execution
  • Per-test timeout support using Tokio timeout
  • Structured progress events:
    • Started
    • Passed
    • Failed
    • Skipped
  • Deterministic result collation in input order
  • Native integration with existing TestReport and TestReportBuilder
  • Support for skipped tests with structured skip metadata

Tests added

Added targeted coverage in async_runner_tests.rs:

  • async_runner_collects_pass_fail_and_skipped
  • async_runner_respects_concurrency_limit
  • async_runner_marks_timeout_as_failed
  • async_runner_emits_progress_events
  • async_runner_uses_injected_clock_for_report

Verification

Ran:

  • cargo test -p mofa-testing

All relevant tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant