(
self, sandbox_name: str, *, timeout_seconds: float = 300.0
)
| 458 | raise SandboxError(f"sandbox {sandbox_name} was not deleted within timeout") |
| 459 | |
| 460 | def wait_ready( |
| 461 | self, sandbox_name: str, *, timeout_seconds: float = 300.0 |
| 462 | ) -> SandboxRef: |
| 463 | deadline = time.time() + timeout_seconds |
| 464 | while time.time() < deadline: |
| 465 | sandbox = self.get(sandbox_name) |
| 466 | if sandbox.status.phase == openshell_pb2.SANDBOX_PHASE_READY: |
| 467 | return sandbox |
| 468 | if sandbox.status.phase == openshell_pb2.SANDBOX_PHASE_ERROR: |
| 469 | raise SandboxError(f"sandbox {sandbox_name} entered error phase") |
| 470 | time.sleep(1) |
| 471 | raise SandboxError(f"sandbox {sandbox_name} was not ready within timeout") |
| 472 | |
| 473 | def exec_stream( |
| 474 | self, |
no test coverage detected