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

Abierto
#2,157 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@houko ya está trabajando en esto.

Desde el 23/11/2026.

  • #2188 de @houko — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.
Lenguaje dominante
Go
Estrellas
684
Forks
41
Merge medio
8 h 8 min
PR fusionados (30 d)
911

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nsgo-dev/nsgo

Todos los issues de nsgo-dev/nsgo

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.