ci(wayland-e2e): poll for a warm screenshot instead of a single fixed sleep#379
Draft
latekvo wants to merge 1 commit into
Draft
ci(wayland-e2e): poll for a warm screenshot instead of a single fixed sleep#379latekvo wants to merge 1 commit into
latekvo wants to merge 1 commit into
Conversation
… sleep
The 'Screenshot returns real pixels' step took one screenshot 15s after
boot_completed and required it to be >20 KB. That races two independent
warm-up delays: SurfaceFlinger painting the lockscreen, and the
simulator-server's screenshot stream only starting to warm on the first
capture request. On slow/contended runners the first (and only) capture
comes back either as a '{"error":"...no image to export"}' response
with no .data envelope (KeyError: 'data') or an all-zero framebuffer that
PNG-compresses to a few KB, failing the step even though the boot was
healthy.
Replace the single attempt with a bounded poll (15 attempts, 4s apart):
each request also warms the stream, and we stop as soon as a frame
exceeds 20 KB. Healthy boots still pass in the first attempt or two;
genuinely broken framebuffers still fail, now with per-attempt diagnostics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Boot + drive AVD on headless Weston job's "Screenshot returns real pixels" step takes a single screenshot 15s after
boot_completedand asserts it is > 20 KB. That single shot races two independent warm-up delays:On slow/contended runners the one-and-only capture comes back as either:
{"error":"...no image to export"}— a cold stream, response has no.dataenvelope, so the step'sjson.load(...)['data']raisesKeyError: 'data'; or> 20 KBcheck.Either way the step fails even though the boot was healthy. This is intermittent — the same commit passes most runs and fails some.
Fix
Replace the single fixed
sleep 15+ one capture with a bounded poll (15 attempts, 4s apart). Each request also warms the stream, and the loop exits as soon as a frame exceeds 20 KB. A cold-stream error response is tolerated and retried rather than aborting the step. Genuinely broken framebuffers still fail, now with per-attempt diagnostics in the log.Verification
The workflow file is unchanged elsewhere; only this step's
run:script changed.prettier --checkpasses on the workflow file.run:script and ran it against a mockcurlcovering: cold-error → all-zero frame → real frame (exits 0 on the real frame); always-cold (exits 1 after 15 attempts); always all-zero framebuffer (exits 1). Exit codes confirmed 0 / 1 respectively.