| 29 | |
| 30 | @pytest.fixture(scope="session", autouse=True) |
| 31 | def 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 |