macos: TestInputMethodCommitAndSinkCandidates times out waiting for focus after other window tests

Aperta
#2,157 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@houko ci sta già lavorando.

Dal 23/11/2026.

  • #2188 di @houko — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Context

TestInputMethodCommitAndSinkCandidates (internal/platform/macos/input_native_test.go) runs itself in a child process (NSGO_TEST_IME_PROCESS), sends key("mod+1") and waits up to 5 s for the "single" input to take focus (waitFor("single focused", ...) at line 178). It fails intermittently:

--- FAIL: TestInputMethodCommitAndSinkCandidates (5.21s)
    input_native_test.go:34: exit status 1
        === RUN   TestInputMethodCommitAndSinkCandidates
            input_native_test.go:317: timed out waiting for single focused (log=[])

The empty log means the mod+1 binding never reached the app.

Why it matters

It fails about 2 runs in 6 on main when other window tests run in the same package, which makes the macOS job unreliable for unrelated changes.

Repro

On a Mac over SSH: go test -count=6 ./internal/platform/macos/ -run 'TestInputMethodCommitAndSinkCandidates|Direction' failed 2 of 6 on main. Run alone it did not fail in 11 runs, so it looks like key-window or focus timing after an earlier window test, rather than an input-method bug.

Proposal

Before sending mod+1, wait until the test window is the key window (and the app is active), the way other native input tests wait for focus, instead of sending the key as soon as the child starts. If the child can't become key, fail with that reason rather than a focus timeout.

Acceptance
  • The repro above passes -count=20.
Lingua principale
Go
Stelle
684
Fork
41
Merge medio
8h 8m
PR unite (30g)
911

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nsgo-dev/nsgo

Tutte le issue di nsgo-dev/nsgo

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.