Skip to content
This repository was archived by the owner on Oct 25, 2026. It is now read-only.

test: cover diff interrupt state lock release - #3

Merged
so0k merged 1 commit into
open-constructs:mainfrom
sakul-learning:test/diff-lock-release-e2e
Jul 1, 2026
Merged

so0k merged 1 commit into
open-constructs:mainfrom
sakul-learning:test/diff-lock-release-e2e

Conversation

@sakul-learning

Copy link
Copy Markdown
Contributor

Summary

  • Adds a focused termless regression test for cdktn diff interrupt handling while Terraform owns an HTTP backend state lock.
  • Uses an in-process HTTP backend that delays state reads after LOCK, creating a deterministic window to press Ctrl-C during terraform plan without cloud resources or provider timing dependencies.
  • Asserts that the CLI waits for Terraform to exit naturally and that the backend observes UNLOCK, rather than leaving the state lock orphaned.

What this test covers

This is the diff/terraform plan counterpart to the existing deploy interrupt lock-release coverage. It specifically exercises the non-deploy path where cdktn diff shells out to Terraform and should not resolve/exit before Terraform has completed its own interrupt cleanup.

The test fails with an affected CLI build by showing the backend events stop after LOCK and a delayed GET, with no UNLOCK observed after Ctrl-C.

Validation

  • pnpm typecheck ✅
  • CLI_ID=cdktn-prhead pnpm exec vitest run tests/diff-lock-release.test.ts — currently reproduces the regression against the provisioned affected CLI build, failing because no UNLOCK is observed after Ctrl-C.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants