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 Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· 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) { | |||
| 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 | 114 | // showImages validates the images with a TEST_ONLY modeset and falls back | |
| 133 | 115 | // to linear images when KMS refuses the driver's. | |
| 134 | 116 | 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 back | 114 | // 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 | |||
| 129 | 129 | err = syncfile.Wait(ctx, done) | |
| 130 | 130 | done.Close() | |
| 131 | 131 | if err != nil { | |
| 132 | + | if ctx.Err() != nil { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 132 | 135 | return fmt.Errorf("frame fence: %w", err) | |
| 133 | 136 | } | |
| 134 | 137 | } | |
| @@ -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 | } | ||