Skip to content

Commit 51582e8

Browse files
dobracjakubno
andauthored
fix: update kill test to use valid sandbox ID format (#1169)
The infra now validates sandbox ID format (^[a-z0-9]+$), allowing only lowercase alphanumeric characters. The test was using 'non-existing-sandbox' which fails format validation due to hyphens, returning a 400 error instead of reaching the expected 404 path. This updates the test to use 'nonexistingsandbox' — a valid format that doesn't exist, so it properly hits the 404 "not found" response and returns false as expected. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: test-only change that updates hardcoded IDs to match new validation rules, without modifying runtime logic. > > **Overview** > Updates JS and Python SDK `kill non-existing sandbox` tests to use a lowercase alphanumeric sandbox ID (`nonexistingsandbox`) instead of a hyphenated one, so the tests exercise the intended *not-found* path rather than failing format validation. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e43acb6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Jakub Novak <jakub@e2b.dev>
1 parent 7e7445d commit 51582e8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/js-sdk/tests/api/kill.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ sandboxTest.skipIf(isDebug)(
1717
)
1818

1919
sandboxTest.skipIf(isDebug)('kill non-existing sandbox', async () => {
20-
await expect(Sandbox.kill('non-existing-sandbox')).resolves.toBe(false)
20+
await expect(Sandbox.kill('nonexistingsandbox')).resolves.toBe(false)
2121
})

packages/python-sdk/tests/async/api_async/test_sbx_kill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ async def test_kill_existing_sandbox(async_sandbox: AsyncSandbox, sandbox_test_i
1818

1919
@pytest.mark.skip_debug()
2020
async def test_kill_non_existing_sandbox():
21-
assert not await AsyncSandbox.kill("non-existing-sandbox")
21+
assert not await AsyncSandbox.kill("nonexistingsandbox")

packages/python-sdk/tests/sync/api_sync/test_sbx_kill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def test_kill_existing_sandbox(sandbox: Sandbox, sandbox_test_id: str):
1818

1919
@pytest.mark.skip_debug()
2020
def test_kill_non_existing_sandbox():
21-
assert not Sandbox.kill("non-existing-sandbox")
21+
assert not Sandbox.kill("nonexistingsandbox")

0 commit comments

Comments
 (0)