MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / ensure_sandbox_persistence_ready

Function ensure_sandbox_persistence_ready

e2e/python/conftest.py:31–52  ·  view source on GitHub ↗
(sandbox_client: SandboxClient)

Source from the content-addressed store, hash-verified

29
30@pytest.fixture(scope="session", autouse=True)
31def ensure_sandbox_persistence_ready(sandbox_client: SandboxClient) -> None:
32 for _ in range(60):
33 try:
34 sandbox_client.list_ids(limit=1)
35 return
36 except grpc.RpcError as exc:
37 details = exc.details() or ""
38 if exc.code() == grpc.StatusCode.UNAVAILABLE:
39 time.sleep(2)
40 continue
41 if (
42 exc.code() == grpc.StatusCode.INTERNAL
43 and "no such table: objects" in details
44 ):
45 time.sleep(1)
46 continue
47 raise
48
49 pytest.fail(
50 "openshell-server persistence is not initialized (missing sqlite objects table); "
51 "redeploy the active cluster and rerun e2e sandbox tests"
52 )
53
54
55@pytest.fixture

Callers

nothing calls this directly

Calls 3

list_idsMethod · 0.80
codeMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected