Skip to content

test(events): cover parallel project command execution#6469

Open
krewenki wants to merge 2 commits into
runatlantis:mainfrom
krewenki:krewenki/parallel-plan-regression-tests
Open

test(events): cover parallel project command execution#6469
krewenki wants to merge 2 commits into
runatlantis:mainfrom
krewenki:krewenki/parallel-plan-regression-tests

Conversation

@krewenki
Copy link
Copy Markdown
Contributor

@krewenki krewenki commented May 12, 2026

What

Adds a deterministic regression test for the shared project command pool executor used by parallel plan and parallel apply.

The new test covers both command.Plan and command.Apply, starts two projects in the same execution-order group with a pool size of two, and uses channels to prove both projects enter execution before either one is allowed to complete.

Why

The existing executor tests showed that commands completed, but they did not prove that more than one project was actually in flight before completion. This catches regressions where the parallel executor path accidentally becomes serialized while still returning successful results.

Validation

  • gofmt -w server/events/project_command_pool_executor_test.go
  • GOCACHE=/private/tmp/codex-go-build go test ./server/events -run 'TestRunProjectCmdsWithCancellationTracker_ParallelPlanAndApplyRunConcurrently|TestRunProjectCmdsParallel|TestRunProjectCmdsWithCancellationTracker'
  • goimports -l server/events/project_command_pool_executor_test.go
  • git diff --check

Add a deterministic channel-barrier regression test for the shared parallel plan and apply executor path. The test proves both projects enter execution before either can complete.

Signed-off-by: Warren Krewenki <19960+krewenki@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
@krewenki krewenki marked this pull request as ready for review May 12, 2026 13:52
Copilot AI review requested due to automatic review settings May 12, 2026 13:52
@dosubot dosubot Bot added the go Pull requests that update Go code label May 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a deterministic regression test that verifies the shared project command pool executor actually runs multiple projects concurrently (not just “eventually succeeds”) for both plan and apply.

Changes:

  • Adds TestRunProjectCmdsWithCancellationTracker_ParallelPlanAndApplyRunConcurrently covering both command.Plan and command.Apply.
  • Uses a blocking runner plus entered/completed channels to prove two projects enter execution before either is allowed to complete.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 15, 2026
@nitrocode nitrocode enabled auto-merge (squash) May 15, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants