Repository navigation
test(e2e): add comprehensive parallel task execution test for issue #5451 - #6221
Conversation
Add comprehensive e2e test to verify that tasks with ::: syntax run concurrently rather than sequentially. The test: - Creates 6 tasks that each sleep for 2 seconds - Measures timing to ensure tasks start concurrently (within 1s) - Verifies total execution time is appropriate for parallel execution - Logs detailed timing information for analysis This addresses the intermittent issue reported in GitHub discussion #5451 where parallel tasks would sometimes run sequentially after version 2025.5.14. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add critical validation to ensure all tasks start before any complete, which is essential for confirming true parallel execution behavior. The test now verifies: - All tasks start within a small time window (concurrency check) - All tasks start before any task completes (parallelism check) - Total execution time is appropriate for parallel vs sequential This addresses the core issue from #5451 where tasks would run sequentially instead of in parallel, providing comprehensive detection of both timing and execution order problems. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
Adds an end-to-end test to detect intermittent parallel task execution issues where tasks with ::: syntax might run sequentially instead of concurrently. The test validates timing, execution order, and completion status across multiple parallel tasks to catch regressions in parallel execution behavior.
- Creates 6 test tasks that each sleep for 2 seconds and run concurrently using
:::syntax - Implements comprehensive timing validation to verify parallel vs sequential execution
- Includes execution order checks and total runtime validation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| for i in {1..6}; do | ||
| if ! grep -q "process${i} complete" <<<"$(mise run run-all)"; then | ||
| echo "ERROR: process${i} did not complete successfully" | ||
| exit 1 | ||
| fi | ||
| done |
There was a problem hiding this comment.
The loop executes mise run run-all for each iteration, running all 6 tasks 6 times unnecessarily. Store the output once before the loop: run_output=$(mise run run-all) and then use <<<"$run_output" in the grep command.
|
|
||
| # Create a temporary file to track task execution order and timing | ||
| temp_log=$(mktemp) | ||
| trap 'rm -f $temp_log' EXIT |
There was a problem hiding this comment.
The variable $temp_log should be quoted to handle potential spaces in the path: trap 'rm -f "$temp_log"' EXIT
| trap 'rm -f $temp_log' EXIT | |
| trap 'rm -f "$temp_log"' EXIT |
Fix critical issue where completion verification loop was re-executing 'mise run run-all' multiple times instead of checking the captured output from the initial execution. This fix: - Captures task output from single execution - Uses captured output for completion verification - Significantly reduces test duration - Prevents interference with timing analysis - Eliminates potential false positives from multiple runs The test now executes the parallel tasks exactly once, making timing measurements accurate and reliable for detecting the intermittent sequential execution issue from #5451. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.5 x -- echo |
20.1 ± 0.3 | 19.2 | 23.7 | 1.00 |
mise x -- echo |
20.3 ± 0.3 | 19.4 | 21.2 | 1.01 ± 0.02 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.5 env |
19.6 ± 0.5 | 18.8 | 23.9 | 1.00 ± 0.03 |
mise env |
19.5 ± 0.4 | 18.4 | 23.4 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.5 hook-env |
19.2 ± 0.3 | 18.4 | 20.4 | 1.00 |
mise hook-env |
19.6 ± 0.3 | 18.7 | 20.7 | 1.02 ± 0.02 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.5 ls |
17.4 ± 0.2 | 16.9 | 18.3 | 1.00 |
mise ls |
17.7 ± 0.3 | 16.8 | 19.7 | 1.02 ± 0.02 |
xtasks/test/perf
| Command | mise-2025.9.5 | mise | Variance |
|---|---|---|---|
| install (cached) | 170ms | ✅ 106ms | +60% |
| ls (cached) | 65ms | 64ms | +1% |
| bin-paths (cached) | 69ms | 70ms | -1% |
| task-ls (cached) | 502ms | 505ms | +0% |
✅ Performance improvement: install cached is 60%
Summary
:::syntax run concurrently rather than sequentiallyDetails
The test creates 6 tasks that each sleep for 2 seconds and validates:
Test Results
Test Plan
This addresses the intermittent issue where parallel tasks would sometimes run sequentially after version 2025.5.14, providing comprehensive detection for future regressions.
🤖 Generated with Claude Code