The zero-timeout smoke tests now skip, instead of failing, if the driver
answered first, whether with a success or an initialization error.
test_gpu waits for its timed-out request without a limit while it holds the
GPU lock. A request that never finishes then shows up as a slow test,
instead of the next GPU test starting beside it.
Signed-off-by: FredApps <[email protected]>
bounded_readback's test_gpu now waits for its own timed-out request before
releasing GPU_LOCK, so the next GPU test doesn't start beside a request still
inside the driver. init_timeout no longer reads the process-wide count. The
renderer test skips if the driver answered before the zero timeout, instead of
failing.
Signed-off-by: FredApps <[email protected]>
Review follow-ups:
- A timed-out request now returns `GpuContextError::TimedOut` with an
`AbandonedRequest` handle (same message as before). `GpuRenderer`
keeps only its own handle and waits on that when dropped, so an
ordinary adapter failure no longer waits for another renderer's
abandoned request.
- The result goes through a rendezvous channel, and the receiver is
dropped on timeout, so an unclaimed context is dropped on the worker
before the request counts as finished.
- The timeout is now `run_with_timeout`, unit-tested with held work:
it counts as running until released, and an unclaimed result is
dropped first.
- The docs say what a `false` from either wait means.
Signed-off-by: FredApps <[email protected]>
`NativeContext::request` gives up after its timeout (10 s by default) but
leaves its `pc_gpu_init` thread inside wgpu and the driver. When the
process then exits, the driver is torn down under that thread, and
Lavapipe crashes the process: on a loaded CI runner two headless GPU
tests took the "no GPU adapter available" path, printed ok, and then
died with SIGSEGV ("error: scalar-to-vector conversion failed" from
LLVM) as the test process exited (#9824's Ubuntu gate).
Count the initialization threads a request gave up on, and add
`NativeContext::wait_for_abandoned_requests(limit)` to wait for them.
A `GpuRenderer` whose request failed now waits (at least 30 s, bounded)
for its abandoned request when it is dropped, so the process no longer
exits under it.
Signed-off-by: FredApps <[email protected]>