Skip to content

Drain stdin in the keyboard test's gum stub - #209

Merged
malik-na merged 1 commit into
quattrofrom
kb-196-fix
Aug 24, 2026
Merged

malik-na merged 1 commit into
quattrofrom
kb-196-fix

Conversation

@scottjones

Copy link
Copy Markdown
Collaborator

tests/test-keyboard-layouts.sh, added in #196, fails intermittently — 6 of 10 runs here, on a different layout each time, which reads like a bad mapping and isn't one.

The prompt is printf … | cut -d'|' -f1 | gum choose …. The test's gum stub prints its answer and exits without reading stdin, so cut takes SIGPIPE; under pipefail the prompt treats that as a failed selection and returns before setting keyboard, keyboard_xkb_layout or keyboard_xkb_variant, leaving the assertions comparing empty strings. Whether it fires depends on whether cut finishes writing 48 lines before the stub exits.

Draining stdin in the stub fixes it: 12 of 12 runs clean before rebase, 8 of 8 after. Same trap as the one brcmfmac-supplicant-test.sh documents for omacom#6608.

The prompt pipes the layout list into gum, and a stub that exits without
reading it kills cut with SIGPIPE. Under pipefail the prompt reads that as a
failed selection and returns before setting anything, so the assertions saw
empty values -- 6 of 10 runs failed, on a different layout each time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@scottjones
scottjones requested a review from malik-na August 24, 2026 01:43
@malik-na
malik-na merged commit 715fc8c into quattro Aug 24, 2026
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.

2 participants