Skip to content

Add timeouts to e2e fetch() requests#606

Closed
aron-cf wants to merge 5 commits intomainfrom
e2e-refactor
Closed

Add timeouts to e2e fetch() requests#606
aron-cf wants to merge 5 commits intomainfrom
e2e-refactor

Conversation

@aron-cf
Copy link
Copy Markdown
Contributor

@aron-cf aron-cf commented Apr 21, 2026

This makes it easier to see which part of the test was slow vs. the entire test failing due to timeout.

Also updated the response body assertions to use expect(body).resolves.toEqual(...), this then makes it easier to see what the response body actually looked like on failure.


Open in Devin Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 21, 2026

⚠️ No Changeset found

Latest commit: 0baca24

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/sandbox-sdk/@cloudflare/sandbox@606

commit: 0baca24

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

📦 Preview Build

Version: 0.0.0-pr-606-0baca24

Install the SDK preview:

npm i https://pkg.pr.new/cloudflare/sandbox-sdk/@cloudflare/sandbox@606

🐳 Docker images were not rebuilt — no container changes detected. Use the latest release images from Docker Hub.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@aron-cf aron-cf force-pushed the e2e-refactor branch 4 times, most recently from 81d1faa to fb556aa Compare April 21, 2026 15:38
devin-ai-integration[bot]

This comment was marked as resolved.

@aron-cf aron-cf force-pushed the e2e-refactor branch 3 times, most recently from da7ba83 to 861ef20 Compare April 21, 2026 16:17
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 18 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/sandbox/src/sandbox.ts Outdated
@aron-cf aron-cf marked this pull request as draft April 22, 2026 12:34
@whoiskatrin
Copy link
Copy Markdown
Collaborator

/bonk rebase this branch

aron-cf added 2 commits April 28, 2026 17:43
Unconditionally passing keepAlive: false triggers
setKeepAlive(false) → renewActivityTimeout(), resetting the
sleepAfter countdown on every request when the Worker isolate
recycles and the configuration cache is cold.
Replace fetchOrTimeout with fetchWithRetry for boot-time resilience.
Default sleepAfter to 1m across all test sandboxes. Send routing
headers on every request and set sleepAfter as a separate post-boot
call. Add short timeouts to cleanup requests so teardown never hangs.
aron-cf added 3 commits April 28, 2026 17:43
AbortSignal.timeout on every fetch call ensures individual requests
fail fast instead of hanging until the test-level timeout fires.
await expect(res.json()).resolves.toEqual() surfaces the actual
response body in failure messages instead of a rejected-promise
error, making CI failures easier to diagnose.
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 28, 2026

Rebase complete. The e2e-refactor branch has been rebased onto main and force-pushed. Here's a summary:

  • 5 commits rebased cleanly onto origin/main
  • 1 commit dropped (Add workers-types to e2e tests) - already upstream
  • 3 conflicts resolved:
    • process-lifecycle-workflow.test.ts: Kept POST method (from main's API change) + added AbortSignal.timeout
    • build-test-workflow.test.ts: Kept 410/SESSION_TERMINATED error contract (from main) + applied .resolves.toEqual assertion style (from PR)
    • git-clone-workflow.test.ts: Kept flexible status/regex matching (from main) + applied .resolves.toEqual assertion style (from PR)

github run

@aron-cf aron-cf closed this May 1, 2026
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