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

オープン
#2,157 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@houko がすでに取り組んでいます。

2026年11月23日 から。

  • #2188 @houko による — オープン

評価

この issue はまだ評価されていません。

説明

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.
主要言語
Go
スター
684
フォーク
41
平均マージ
8時間 8分
マージ済み PR(30日)
911

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nsgo-dev/nsgo のほかの issue

nsgo-dev/nsgo の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。