Skip to content

fix(native): stop the eglInitialize flake in the render tests - #776

Merged
omartelo merged 4 commits into
mainfrom
fix/native-egl-flake
Oct 16, 2026
Merged

omartelo merged 4 commits into
mainfrom
fix/native-egl-flake

Conversation

@omartelo

@omartelo omartelo commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

The native render tests skipped intermittently on CI with eglInitialize failed: 0x3001 (3 of the last 15 native runs, main included), and a skip fails the job.

Root cause

Each headless.NewWindow opens the default EGL display, which on Mesa's X11 platform is its own Xvfb connection, and Release closes it. That connection is the only client, so Xvfb regenerates the server every time a test window goes away: 63 to 66 server generations per go test ./... run, counted from the xkbcomp lines Xvfb logs on each reset. An eglInitialize that lands while the server is resetting gets EGL_BAD_ALLOC ... xcb_connect failed (EGL_LOG_LEVEL=debug), which Gio reports as 0x3001. All 19 failures in the measurement loop were this one error.

Fix

Start Xvfb with -noreset (the screen argument stays the runner's xvfb-run default, -screen 0 1280x1024x24). No test, skip or guard changed.

Measurement

Temporary loop on ubuntu-latest, full xvfb-run go test -v ./... per iteration, counting no headless GPU:

variant runs runs with a skip skips server generations per run
baseline 60 + 80 11 + 17 (20%) 14 + 19 63 to 66
-noreset 80 0 0 1

EGL_PLATFORM=surfaceless also went 0/60, but it sidesteps X instead of fixing the reset. The loop workflow is removed from this branch.

@omartelo
omartelo marked this pull request as ready for review October 16, 2026 16:25
@omartelo
omartelo merged commit c9176d9 into main Oct 16, 2026
9 checks passed
@omartelo
omartelo deleted the fix/native-egl-flake branch October 16, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant