detached d129f9d

fix(headless): stop quietly when a frame fence wait is canceled at shutdown

commit
d129f9dffb86d0f2fe73b48ed4ee50d0fbb6da72
author
brice · · 2026-09-26 11:09 UTC
parent
cb321d4
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +3 -18
M internal/adapters/drm/commit_test.go +0 -18
@@ -111,24 +111,6 @@ func TestCursorRefusedDoesNotBlameScanoutBuffer(t *testing.T) {
111111 }
112112 }
113113
114-// A cursor-only commit's event still reports content read meanwhile.
115-func TestCursorEventReportsSeen(t *testing.T) {
116- o, _, commits := testOutput(t)
117- o.cursor.image = true
118- o.cursor.Move(1, 1)
119- if err := o.commitState(false); err != nil {
120- t.Fatal(err)
121- }
122- seen := map[ports.WindowID]uint64{2: 5}
123- if !o.completed(eventOf((*commits)[0]), seen) {
124- t.Fatal("event not taken")
125- }
126- // Run reports Seen at the top of its loop once nothing is pending.
127- if o.pending {
128- t.Fatal("still pending")
129- }
130-}
131-
132114 // showImages validates the images with a TEST_ONLY modeset and falls back
133115 // to linear images when KMS refuses the driver's.
134116 func TestShowImagesTestsBeforeModeset(t *testing.T) {
@@ -111,24 +111,6 @@ func TestCursorRefusedDoesNotBlameScanoutBuffer(t *testing.T) {
111 }111 }
112 }112 }
113 113
114-// A cursor-only commit's event still reports content read meanwhile.
115-func TestCursorEventReportsSeen(t *testing.T) {
116- o, _, commits := testOutput(t)
117- o.cursor.image = true
118- o.cursor.Move(1, 1)
119- if err := o.commitState(false); err != nil {
120- t.Fatal(err)
121- }
122- seen := map[ports.WindowID]uint64{2: 5}
123- if !o.completed(eventOf((*commits)[0]), seen) {
124- t.Fatal("event not taken")
125- }
126- // Run reports Seen at the top of its loop once nothing is pending.
127- if o.pending {
128- t.Fatal("still pending")
129- }
130-}
131-
132 // showImages validates the images with a TEST_ONLY modeset and falls back114 // showImages validates the images with a TEST_ONLY modeset and falls back
133 // to linear images when KMS refuses the driver's.115 // to linear images when KMS refuses the driver's.
134 func TestShowImagesTestsBeforeModeset(t *testing.T) {116 func TestShowImagesTestsBeforeModeset(t *testing.T) {
M internal/adapters/headless/output.go +3 -0
@@ -129,6 +129,9 @@ func Run(ctx context.Context, opts Options, scenes <-chan ports.Scene, contents
129129 err = syncfile.Wait(ctx, done)
130130 done.Close()
131131 if err != nil {
132+ if ctx.Err() != nil {
133+ return nil
134+ }
132135 return fmt.Errorf("frame fence: %w", err)
133136 }
134137 }
@@ -129,6 +129,9 @@ func Run(ctx context.Context, opts Options, scenes <-chan ports.Scene, contents
129 err = syncfile.Wait(ctx, done)129 err = syncfile.Wait(ctx, done)
130 done.Close()130 done.Close()
131 if err != nil {131 if err != nil {
132+ if ctx.Err() != nil {
133+ return nil
134+ }
132 return fmt.Errorf("frame fence: %w", err)135 return fmt.Errorf("frame fence: %w", err)
133 }136 }
134 }137 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 23

Tags 10

↑↓ moveenter openesc close