Skip to content

Fix Vault e2e test startup race#4198

Merged
stevenvegt merged 2 commits into
masterfrom
fix-vault-e2e-startup
Apr 16, 2026
Merged

Fix Vault e2e test startup race#4198
stevenvegt merged 2 commits into
masterfrom
fix-vault-e2e-startup

Conversation

@stevenvegt

Copy link
Copy Markdown
Member

Summary

The Vault e2e test was flaky in CI because the node container started before vault-adapter was reachable, causing DID creation to fail with context deadline exceeded waiting for vault-adapter HTTP responses. Without explicit healthchecks and dependencies, docker compose started all three services in parallel, and the node's first HTTP calls to vault-adapter landed before vault-adapter had connected to vault.

Changes

  • vault: added a healthcheck using vault status (exits 0 when unsealed; dev mode is always unsealed)
  • vault-adapter: added depends_on vault (condition: service_healthy); kept the image's built-in HEALTHCHECK but reduced the interval for faster e2e startup
  • node: added depends_on vault-adapter (condition: service_healthy)
  • run-test.sh: switched --wait vault to --wait vault-adapter (vault-adapter healthy transitively implies vault healthy; vault's old --wait was a no-op since the image has no HEALTHCHECK)

Test plan

  • e2e-tests/storage/vault/run-test.sh passes locally

🤖 Generated with Claude Code

The vault e2e test was flaky because the node container started before
vault-adapter was reachable, causing DID creation to time out with
"context deadline exceeded" waiting for vault-adapter.

Add explicit healthchecks and depends_on:
- vault: healthcheck via `vault status` CLI (exits 0 when unsealed)
- vault-adapter: depends_on vault (service_healthy); override the image's
  built-in healthcheck interval for faster e2e startup
- node: depends_on vault-adapter (service_healthy)

Switch run-test.sh from `--wait vault` to `--wait vault-adapter`, since
vault-adapter healthy transitively implies vault healthy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qltysh

qltysh Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Some CI runners (e.g. GitHub Actions) don't grant CAP_SETFCAP, so vault's
entrypoint fails at startup with:

  unable to set CAP_SETFCAP effective capability: Operation not permitted

SKIP_SETCAP=true tells the vault entrypoint to skip the setcap call on its
binary. mlock isn't required for dev mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@stevenvegt
stevenvegt merged commit 091684c into master Apr 16, 2026
11 checks passed
@stevenvegt
stevenvegt deleted the fix-vault-e2e-startup branch April 16, 2026 09:08
reinkrul pushed a commit that referenced this pull request Apr 16, 2026
Probably due to a new version of vault, the e2e test failed. Vault tried to set setcap in vault container for CI compatibility which is not allowed by the CI runner.

Created the correct container dependencies and skip the setcap for vault fixed the problem.
reinkrul added a commit that referenced this pull request Apr 16, 2026
Probably due to a new version of vault, the e2e test failed. Vault tried to set setcap in vault container for CI compatibility which is not allowed by the CI runner.

Created the correct container dependencies and skip the setcap for vault fixed the problem.

Co-authored-by: Steven van der Vegt <steven.vandervegt@s-curve.nl>
reinkrul added a commit that referenced this pull request Apr 17, 2026
Cherry-picked 091684c. The Vault CI runner rejects setcap and the e2e
test racing against vault startup caused DID creation to hit a
context-deadline-exceeded against vault-adapter. Added service_healthy
dependencies and SKIP_SETCAP=true.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
reinkrul added a commit that referenced this pull request Apr 17, 2026
* Backport: add index for auth creds (#3562/#3564) to V5.4

Adds the compound index `index_auth_subject_purpose_resources`
(credentialSubject.id + purposeOfUse + resources.path) so
POST /internal/vcr/v2/search queries for NutsAuthorizationCredential
stop falling back to `index_issuer` and scanning every credential issued
by the requesting care organization. Also removes the now-redundant
`index_subject` (its parts are a prefix of the new index).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Backport: fix Vault e2e test startup race (#4198) to V5.4

Cherry-picked 091684c. The Vault CI runner rejects setcap and the e2e
test racing against vault startup caused DID creation to hit a
context-deadline-exceeded against vault-adapter. Added service_healthy
dependencies and SKIP_SETCAP=true.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add v5.4.32 release notes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants