Skip to content

fix: increase background build test timeouts to reduce flakiness#1269

Draft
mishushakov wants to merge 2 commits intomainfrom
mishushakov/flaky-test-analysis
Draft

fix: increase background build test timeouts to reduce flakiness#1269
mishushakov wants to merge 2 commits intomainfrom
mishushakov/flaky-test-analysis

Conversation

@mishushakov
Copy link
Copy Markdown
Member

Summary

  • Increased buildInBackground test timeouts from 10s to 30s across JS SDK, Python async, and Python sync tests
  • The 10s timeout was too tight for the 2+ API roundtrips (requestBuild + triggerBuild) that run before returning, causing frequent CI timeouts especially in Production environments
  • These tests were the most common source of flaky failures in sdk_tests.yml over the past week

Test plan

  • Verify background build tests pass on CI (both Staging and Production, ubuntu and windows)
  • Confirm no more timeout-related failures in subsequent runs

🤖 Generated with Claude Code

The 10s timeout was too tight for the 2+ API roundtrips (requestBuild + triggerBuild) that buildInBackground makes before returning, causing frequent timeouts in CI especially on Production environments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 13, 2026

⚠️ No Changeset found

Latest commit: cd65c0c

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

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 13, 2026

PR Summary

Low Risk
Only adjusts SDK test timeouts/markers; no production code changes, with the main risk being longer CI hangs if a build truly stalls.

Overview
Background buildInBackground tests are made less flaky by allowing substantially more time for the build to start.

In the JS SDK, the Vitest timeout for backgroundBuild.test.ts is increased from 10_000 to 180_000. In the Python SDK (sync and async), the @pytest.mark.timeout(10) decorators are removed from the equivalent background build tests.

Reviewed by Cursor Bugbot for commit cd65c0c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Package Artifacts

Built from c09c483. Download artifacts from this workflow run.

JS SDK (e2b@2.19.1-mishushakov-flaky-test-analysis.0):

npm install ./e2b-2.19.1-mishushakov-flaky-test-analysis.0.tgz

CLI (@e2b/cli@2.9.1-mishushakov-flaky-test-analysis.0):

npm install ./e2b-cli-2.9.1-mishushakov-flaky-test-analysis.0.tgz

Python SDK (e2b==2.20.0+mishushakov-flaky-test-analysis):

pip install ./e2b-2.20.0+mishushakov.flaky.test.analysis-py3-none-any.whl

Use 180s like other template tests instead of a custom short timeout. Python tests now inherit the 180s default from conftest.py instead of overriding it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread packages/js-sdk/tests/template/backgroundBuild.test.ts
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cd65c0c. Configure here.

Comment thread packages/js-sdk/tests/template/backgroundBuild.test.ts
@mishushakov mishushakov marked this pull request as draft April 13, 2026 19:55
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