Bug 226947

Summary: WebXR tests often fail due to running out of GraphicsContextGLs
Product: WebKit Reporter: Sam Weinig <sam>
Component: WebXRAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ifernandez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Sam Weinig 2021-06-11 18:07:53 PDT
SimulatedXRDevice::shutDownTrackingAndRendering() should clear its GraphicsContextGL to ensure the resource is cleaned up quickly, and doesn't wait for GC to be reclaimed. Without this, we can run out of GraphicsContextGLs (e.g. GraphicsContextGLOpenGLManager::hasTooManyContexts()) and fail tests if GC happens to be running a bit behind.
Comment 1 Sam Weinig 2021-06-11 18:09:29 PDT
Created attachment 431247 [details]
Patch
Comment 2 Sam Weinig 2021-06-11 18:15:16 PDT
The test I used for this was:

`run-webkit-tests imported/w3c/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html --repeat=40`

Prior to this change it would fail periodically, now it passes 100%.
Comment 3 EWS 2021-06-13 11:42:52 PDT
Committed r278820 (238773@main): <https://commits.webkit.org/238773@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 431247 [details].
Comment 4 Radar WebKit Bug Importer 2021-06-13 11:43:19 PDT
<rdar://problem/79263505>