Skip to content

test(e2e): isolate enterprise sso test runs#8660

Merged
jacekradko merged 1 commit into
mainfrom
jacek/fix-enterprise-sso-test-isolation
May 27, 2026
Merged

test(e2e): isolate enterprise sso test runs#8660
jacekradko merged 1 commit into
mainfrom
jacek/fix-enterprise-sso-test-isolation

Conversation

@jacekradko
Copy link
Copy Markdown
Member

@jacekradko jacekradko commented May 27, 2026

This was causing persistent E2E failures on unrelated PRs. This change should avoid same-type failures in the future.

The enterprise SSO test pinned a single connection name + domain (E2E Test SAML Connection / e2e-enterprise-test.dev) on a shared long-running staging instance. When a run failed between the create in beforeAll and the delete in afterAll, the connection survived and every subsequent run got a 422 from BAPI on the duplicate domain. The 422 in beforeAll left enterpriseConnection undefined, and afterAll then crashed reading .id, masking the real error.

Suffix the connection name and domain with a 4-byte hex per run, and guard the afterAll delete on enterpriseConnection being defined so a beforeAll failure surfaces in the report instead of being shadowed by a TypeError.

Stale connection on the staging instance was deleted out of band.

Suffix the SAML connection name/domain with a random per-run id, and
skip the afterAll delete when beforeAll never assigned the connection.
A single failed run on the long-running staging instance no longer
leaves a stale connection that 422s every subsequent create, and a
beforeAll failure now surfaces in the report instead of being masked
by a TypeError in afterAll.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: a8ff252

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 27, 2026 1:22am

Request Review

@jacekradko jacekradko changed the title test(integration): isolate enterprise SSO test runs test(e2e): isolate enterprise sso test runs May 27, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR isolates enterprise SSO test runs by generating unique identifiers per execution. The test now imports randomBytes to create a per-run domain name and connection identifier, replacing the fixed e2e-enterprise-test.dev domain. The enterpriseConnection variable is made optional, and cleanup now conditionally deletes the connection only if beforeAll created it, preventing TypeErrors from masking setup failures.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(e2e): isolate enterprise sso test runs' directly matches the main changeset objective of isolating enterprise SSO test runs with per-run unique identifiers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly explains the issue (stale connections causing 422s), the root cause (crashes masking real errors), and the solution (per-run isolation via hex suffix and guarded cleanup).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 27, 2026

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8660

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8660

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8660

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8660

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8660

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8660

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8660

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8660

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8660

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8660

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8660

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8660

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8660

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8660

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8660

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8660

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8660

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8660

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8660

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8660

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8660

commit: a8ff252

@jacekradko jacekradko merged commit 51344b0 into main May 27, 2026
46 of 47 checks passed
@jacekradko jacekradko deleted the jacek/fix-enterprise-sso-test-isolation branch May 27, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants