From 258bd4456b21bb037583d696b351a2fbb6ceb6e9 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Thu, 30 Jul 2026 06:02:22 +0800 Subject: [PATCH] test(e2b): poll sandbox list convergence --- packages/e2b/e2b/tests/composition.e2e.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/e2b/e2b/tests/composition.e2e.ts b/packages/e2b/e2b/tests/composition.e2e.ts index 2eca4f1f63..bf53ba7bb9 100644 --- a/packages/e2b/e2b/tests/composition.e2e.ts +++ b/packages/e2b/e2b/tests/composition.e2e.ts @@ -178,6 +178,9 @@ describe.skipIf(!process.env.E2B_API_KEY)('E2B live Loader composition', () => { const apiKey = process.env.E2B_API_KEY if (apiKey === undefined) throw new Error('E2B_API_KEY disappeared during the live composition test') await expect(Sandbox.getInfo(String(output.sandboxId), { apiKey })).rejects.toBeInstanceOf(SandboxNotFoundError) - await expect(Sandbox.list({ apiKey }).nextItems()).resolves.toEqual([]) + await expect.poll(async () => { + const sandboxes = await Sandbox.list({ apiKey }).nextItems() + return sandboxes.some(sandbox => sandbox.sandboxId === output.sandboxId) + }, { interval: 250, timeout: 5_000 }).toBe(false) }, 195_000) })