## TL;DR
Sandbox provisioning timeout usually means the agent timeout was set from hope, not measurement, or the provisioning system queues behind other tests. Measure real provisioning times, keep a warm pool of pre-provisioned sandboxes for scheduled tests, set the agent timeout above the measured worst case, and surface queue position so a stuck request is distinguishable from a slow one.

```text
agent timed out waiting for restore sandbox provisioning and the test failed
```

## Use this when
- Restore tests fail before any restore starts, waiting on sandbox creation.
- Provisioning succeeds when the platform is idle and times out under load.
- Timeout values are identical across very different sandbox sizes.

## Not for this skill when
- The sandbox provisions but the VM inside never boots. Boot problem, next stage.
- Provisioning fails instantly with quota errors. Capacity, not timeout tuning.

## Steps
1. Collect provisioning durations from platform logs for the last runs, split by sandbox size. Verify: a duration distribution per size exists
2. Compare the agent timeout with the measured worst normal provisioning time. Verify: the gap or overlap is quantified
3. Create a small warm pool refreshed on schedule for routine restore tests, or pre-provision before large sweeps. Verify: tests can claim a ready sandbox
4. Raise the agent provisioning timeout above measured worst case and add progress polling that distinguishes queued from creating from failed. Verify: the agent reports provisioning stages
5. Run the restore test suite under load and confirm provisioning timeouts are gone or genuinely explained. Verify: tests reach the restore stage reliably

## Variant phrasings
### sandbox provisioning slow agent timeout tuning
The tuning phrasing.
### restore test environment takes too long provision
The duration variant.
### warm pool test sandbox restore verification
The pooling wording.

Compatibility: Agent test harnesses provisioning VMs or containers on vSphere, Hyper-V, AWS, Azure or Kubernetes sandboxes for restore verification.

## Why it happens
Provisioning involves image copies, network setup and storage allocation whose duration scales with image size and platform load, while agent timeouts are often a round number chosen at project start. As images grew and more tests shared the platform, the round number silently became wrong. Measurement and pooling are the durable fixes; blind timeout increases only delay real failure detection.

## Edge cases / pitfalls
- A warm pool costs idle resources. Size it from the test schedule, not from peak imagination.
- Provisioning that hangs forever does happen. Keep an absolute ceiling that aborts and reports, well above normal times.
- Record sandbox identifiers per test. Leaked sandboxes from timed-out tests quietly consume the pool.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_9xia0p4nRcykyUofaEHxIg
