The VA-API hardware tests open their displays on GatedRuntime since
b52eea52f, whose exit gate closes before the drivers' exit-time destructors
run, after iHD aborted a test process that exited while a kept session was let
go on another thread. The NVIDIA arm's tests ran on std's runtime, which has
no gate: its waits fell back to StdRuntime::shared where no backend's opening
made a runtime, and the Annex B decoder's test handed it std's. Its call
threads and the sweep of work kept past a deadline call NVDEC, NVENC and CUDA
on threads of their own, so a test's process could exit beside them the same
way. No abort was seen on NVIDIA.
In a test the NVIDIA waits now fall back to GatedRuntime, which the first load
of a driver's library makes and arms (arm_exit, as Library::open and cuInit
call it), so its hook runs before what the library registered. The Annex B
decoder's test and the session-start probes hand the gated runtime too. One
gate serves the process, whichever arm's driver loads, so the NVIDIA tests use
VA-API's (vaapi::gated) rather than a second one.
A test of the pattern runs in a child process that registers an exit handler
as a driver's library would, then has the crate arm its gate: at exit the
crate's steps are refused by the time that handler runs. On std's runtime they
were still given. The product is unchanged: outside tests the fallback is
std's, as before.