Skip to content

fix(e2e): use unique SSM paths per CLI test run to prevent race conditions#130

Merged
macalbert merged 6 commits intomainfrom
fix/e2e-ssm-path-race-condition
Mar 29, 2026
Merged

fix(e2e): use unique SSM paths per CLI test run to prevent race conditions#130
macalbert merged 6 commits intomainfrom
fix/e2e-ssm-path-race-condition

Conversation

@macalbert
Copy link
Copy Markdown
Owner

@macalbert macalbert commented Mar 26, 2026

Summary

Concurrent CI runs of e2e/cli.test.ts shared hardcoded SSM paths (/Test/Token, /Test/SingleVariable) against real AWS SSM. When two runs overlapped, one run's cleanUpSsm could delete parameters that another run had just created, causing flaky ParameterNotFound errors in the Assert phase.

This fix generates a unique runId per test run and creates temporary map files with isolated SSM paths, eliminating the race condition.

Changes

  • e2e/cli.test.ts
    • Generate a runId (randomUUID().slice(0, 8)) at describe-block scope
    • SSM paths are now /Test/<runId>/Token and /Test/<runId>/SingleVariable
    • Map files are created dynamically in beforeAll (param-map-<runId>.json, param-map-with-aws-config-<runId>.json)
    • Temporary map files are cleaned up in afterAll

Testing

  • pnpm test passes (19/19 unit test files)
  • pnpm lint passes
  • pnpm build passes
  • E2E verification in CI (requires AWS credentials)

Related

Fixes flaky Should_GenerateEnvironmentFile_When_ValidArgumentsAreProvided failure observed in publish-action CI workflow.


Open with Devin

…tions

Concurrent CI runs shared hardcoded SSM paths (/Test/Token,
/Test/SingleVariable) against real AWS SSM, causing ParameterNotFound
errors when one run's cleanup deleted parameters another run had just
created.

Each test run now generates a unique runId and creates temporary map
files with isolated SSM paths (/Test/<runId>/Token). Temp files are
cleaned up in afterAll.
@coderabbitai

This comment was marked as resolved.

@gemini-code-assist

This comment was marked as resolved.

@macalbert macalbert self-assigned this Mar 26, 2026
@macalbert macalbert added the test label Mar 26, 2026
@macalbert macalbert requested a review from Copilot March 26, 2026 01:40
@macalbert macalbert added the bug Something isn't working label Mar 26, 2026
gemini-code-assist[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

This comment was marked as resolved.

Replace sync map-file writes with async Promise.all in beforeAll and use forced rm cleanup in afterAll. This avoids blocking file IO and simplifies teardown for ephemeral test artifacts.
@macalbert macalbert marked this pull request as draft March 29, 2026 18:23
@macalbert macalbert marked this pull request as ready for review March 29, 2026 18:23
@macalbert macalbert merged commit c8295bf into main Mar 29, 2026
5 checks passed
@macalbert macalbert deleted the fix/e2e-ssm-path-race-condition branch March 29, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants