Skip to content

fix(ci): fix e2e integration test timeouts#7792

Open
jacekradko wants to merge 2 commits intomainfrom
jrad/fix-e2e-tests
Open

fix(ci): fix e2e integration test timeouts#7792
jacekradko wants to merge 2 commits intomainfrom
jrad/fix-e2e-tests

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Feb 6, 2026

Summary

  • Integration tests are timing out during global.setup.ts (90s timeout exceeded while waiting for long-running apps to start)
  • This affects all integration test suites (nextjs, quickstart, handshake, sessions, billing, etc.)
  • Same failures reproduce on main

Test plan

  • Investigate root cause of app startup timeouts
  • Fix and verify integration tests pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved server startup performance by running HTTP servers in parallel instead of sequentially.
    • Extended initialization timeout and added performance monitoring for server and app startup processes.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 3461dcd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Feb 6, 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 Feb 6, 2026 8:13pm

Request Review

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7792

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 3461dcd

- Increase setup timeout from 90s to 240s for CI variability
- Start clerkJs and clerkUi HTTP servers in parallel via Promise.all
- Cap http-server polling maxAttempts at 60 (was Infinity)
- Add timing logs for HTTP server startup and app initialization
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The changes modify the server initialization and test setup flow. The HTTP server retry mechanism is constrained to a maximum of 60 attempts instead of unlimited retries. The global setup timeout is increased from 90,000 ms to 240,000 ms. HTTP servers are now started in parallel using Promise.all instead of sequentially. Timing measurements and logs are added to track the duration of server startup and app initialization phases.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main issue: fixing e2e integration test timeouts. The changes increase the global setup timeout from 90s to 240s, optimize server startup with parallel execution, and add timing logs—all aimed at resolving timeout issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@integration/tests/global.setup.ts`:
- Around line 8-23: The PR changes global setup timeout and starts HTTP servers
and app inits in parallel (see setup.setTimeout, startClerkJsHttpServer,
startClerkUiHttpServer, parseEnvOptions, appConfigs.longRunningApps.getByPattern
and app.init) but no tests were added; add/adjust tests to cover the new
behavior by creating integration tests that assert the increased timeout is
applied, both HTTP servers start successfully when run in parallel (mock or test
endpoints for startClerkJsHttpServer and startClerkUiHttpServer), and that apps
returned by appConfigs.longRunningApps.getByPattern are initialized via app.init
with the new parallel flow and saved state behavior; ensure tests fail if
servers or app.init do not complete within the configured timeout and add them
to the appropriate test suite so CI enforces the coverage.

Comment on lines +8 to +23
setup.setTimeout(240_000);

await fs.ensureDir(constants.TMP_DIR);

await startClerkJsHttpServer();
await startClerkUiHttpServer();
const httpServerStart = Date.now();
await Promise.all([startClerkJsHttpServer(), startClerkUiHttpServer()]);
console.log(`HTTP servers started in ${Date.now() - httpServerStart}ms`);

const { appIds } = parseEnvOptions();
if (appIds.length) {
const apps = appConfigs.longRunningApps.getByPattern(appIds);
// state cannot be shared using playwright,
// so we save the state in a file using a strategy similar to `storageState`
const appStart = Date.now();
await Promise.all(apps.map(app => app.init()));
console.log(`Apps initialized in ${Date.now() - appStart}ms`);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add/adjust tests for the new setup behavior.

Lines 8-23 change the global setup timeout and parallel startup flow, but no tests were added or updated in this PR. Please add coverage for these changes before merge. As per coding guidelines, “If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.”

🤖 Prompt for AI Agents
In `@integration/tests/global.setup.ts` around lines 8 - 23, The PR changes global
setup timeout and starts HTTP servers and app inits in parallel (see
setup.setTimeout, startClerkJsHttpServer, startClerkUiHttpServer,
parseEnvOptions, appConfigs.longRunningApps.getByPattern and app.init) but no
tests were added; add/adjust tests to cover the new behavior by creating
integration tests that assert the increased timeout is applied, both HTTP
servers start successfully when run in parallel (mock or test endpoints for
startClerkJsHttpServer and startClerkUiHttpServer), and that apps returned by
appConfigs.longRunningApps.getByPattern are initialized via app.init with the
new parallel flow and saved state behavior; ensure tests fail if servers or
app.init do not complete within the configured timeout and add them to the
appropriate test suite so CI enforces the coverage.

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.

1 participant