Skip to content

test(cli): give the e2e suite a realistic timeout - #380

Merged
gregberge merged 1 commit into
mainfrom
test/cli-e2e-timeout
Sep 11, 2026
Merged

gregberge merged 1 commit into
mainfrom
test/cli-e2e-timeout

Conversation

@gregberge

Copy link
Copy Markdown
Member

Description

The CLI e2e tests spawn the built CLI and call the live Argos API, so they are bound by network latency rather than local compute. Most of them ran on vitest's 5s default, which is too tight on a loaded runner.

In CI run 34607908169 the e2e-core (24, macos-latest) cell failed because argos build get 999999 timed out at 5000ms, while the other 8 matrix cells passed. That is runner and API latency, not a code defect.

packages/cli/vitest.config.ts is now split into two vitest projects so only the e2e files get a generous budget:

Setting unit (src) e2e (e2e)
testTimeout 5000ms (default) 30000ms
hookTimeout 10000ms (default) 30000ms

hookTimeout is raised too: six e2e files seed state from the live API inside beforeAll, and that hook runs on its own 10s budget that the same latency would blow.

Centralizing the timeout makes the hand-written per-test timeouts redundant, so they are removed from comment, deploy, skip, upload, upload-oidc and upload-tokenless. Three of those were set below 30s, so leaving them would have made those tests stricter than the rest of the suite.

Type of changes

bug

Checklist

  • I have read the CONTRIBUTING doc
  • The commits message follows the Conventional Commits' policy
  • Lint and unit tests pass locally
  • I have added tests if needed

Optional checks:

  • My changes requires a change to the documentation
  • I have updated the documentation accordingly

Further comments

What a reviewer should know

The three e2e scripts still work. e2e, e2e-oidc and e2e-tokenless pass path and tag filters, which vitest applies across projects. tags stays declared at the root and both projects inherit it via extends: true. Only tagsFilter is a root-only option in vitest; tags, testTimeout and hookTimeout are all project-level.

Verification. check-types, lint, check-format and the unit suite (84 tests) all pass. The live e2e suite was not run, as no API token was available locally. Instead:

  • vitest list (collects without executing, so no API calls) confirms all three scripts resolve their files, and that the tag filter yields 63 tests vs 64 unfiltered, correctly dropping the OIDC one.
  • Throwaway probe tests confirm the config actually applies, since a config that silently fails to apply would look identical to one that works. A 6s e2e test passes where the old 5s default would have failed it; an 11s beforeAll passes where the 10s default would have failed it; and the same 6s test placed in src still fails at 5000ms, confirming the split does not leak into unit tests.

packages/core/e2e needed nothing. It is plain node scripts with no vitest involved.

One thing worth a second opinion: the e2e-core jobs in .github/workflows/ci.yml set timeout-minutes: 5. A pathological run that now burns 30s per failing test could hit the job ceiling and report as a cancelled job rather than a clean test timeout. Left untouched here as it is out of scope, but happy to bump it in this PR if you'd prefer.

🤖 Generated with Claude Code

The CLI e2e tests spawn the built CLI and call the live Argos API, so
they are bound by network latency rather than local compute. Most ran on
vitest's 5s default, which is too tight on a loaded runner: in CI run
34607908169 the `e2e-core (24, macos-latest)` cell failed because
`build get 999999` timed out at 5000ms, while the other 8 matrix cells
passed.

Split vitest.config.ts into `unit` and `e2e` projects so the e2e files
get a 30s testTimeout, plus a matching 30s hookTimeout for the six files
that seed state from the API in `beforeAll` (the default hook budget is
10s). Unit tests keep the 5s default.

That makes the hand-written per-test timeouts redundant, so drop them
from comment, deploy, skip, upload, upload-oidc and upload-tokenless.
The three e2e scripts keep working: they pass path and tag filters,
which vitest applies across projects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
argos-js-sdk-reference Ready Ready Preview Sep 11, 2026 7:17pm UTC

Request Review

@gregberge
gregberge requested a review from jsfez September 11, 2026 19:17
@gregberge
gregberge merged commit 08478a0 into main Sep 11, 2026
74 checks passed
@gregberge
gregberge deleted the test/cli-e2e-timeout branch September 11, 2026 19:19
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.

1 participant