Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix tests

Jakub Novak253e043aabb7
diff --git a/packages/js-sdk/test/killSandbox.test.mjs b/packages/js-sdk/test/killSandbox.test.mjs
index 4ac152819..e66a16647 100644
--- a/packages/js-sdk/test/killSandbox.test.mjs
+++ b/packages/js-sdk/test/killSandbox.test.mjs
@@ -4,8 +4,7 @@ import { Sandbox } from '../src'
test('kill running sandbox', async () => {
const sandbox = await Sandbox.create()
await Sandbox.kill(sandbox.id)
- await expect(async () => {
- await sandbox.refresh(sandbox.id.split('-')[0])
- }).rejects.toThrowError("Not Found")
+ const list = await Sandbox.list()
+ expect(list.map((s) => s.sandboxID)).not.toContain(sandbox.id)
await sandbox.close()
})
diff --git a/packages/js-sdk/test/templates/dataAnalysis.test.mjs b/packages/js-sdk/test/templates/dataAnalysis.test.mjs
index cf48234ff..6ccd5a735 100644
--- a/packages/js-sdk/test/templates/dataAnalysis.test.mjs
+++ b/packages/js-sdk/test/templates/dataAnalysis.test.mjs
@@ -14,7 +14,7 @@ plt.show()
)
await sandbox.close()
expect(result.artifacts.length).toEqual(1)
-}, 15000)
+}, 17000)
test('test_install_packages', async () => {
diff --git a/packages/python-sdk/tests/test_kill_sandbox.py b/packages/python-sdk/tests/test_kill_sandbox.py
index ad7da853b..79a46f91a 100644
--- a/packages/python-sdk/tests/test_kill_sandbox.py
+++ b/packages/python-sdk/tests/test_kill_sandbox.py
@@ -1,13 +1,11 @@
-import pytest
-
-from e2b import Sandbox, SandboxException
+from e2b import Sandbox
def test_kill_sandbox():
s = Sandbox()
Sandbox.kill(s.id)
- with pytest.raises(SandboxException):
- s._refresh()
+ sandboxes = Sandbox.list()
+ assert s.id not in [sandbox.sandbox_id for sandbox in sandboxes]
s.close()
diff --git a/packages/python-sdk/tests/test_timeout.py b/packages/python-sdk/tests/test_timeout.py
index d5065baec..202c690b2 100644
--- a/packages/python-sdk/tests/test_timeout.py
+++ b/packages/python-sdk/tests/test_timeout.py
@@ -38,7 +38,7 @@ def test_filesystem_timeout():
sandbox.filesystem.write(
"test.txt",
"Hello World",
- timeout=0.01,
+ timeout=0.001,
)
if sandbox: