Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

flake: TestPubsubCluster/ClusterAuthRequired

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

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

2026年8月5日 から。

評価

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

説明

flake

CI failure

The complete 4,462-line Windows job log was available and reviewed. The macOS matrix job was canceled only after the Windows failure; this is not a rerun/cancellation artifact.

Failure evidence

=== FAIL: coderd/x/nats TestPubsubCluster/ClusterAuthRequired (0.04s)
    pubsub_internal_test.go:519:
        Error: Target error should be in err chain:
               expected: "nats: authorization violation"
               in chain: "read tcp 127.0.0.1:59696->127.0.0.1:59631: wsarecv: An existing connection was forcibly closed by the remote host."
                         "wsarecv: An existing connection was forcibly closed by the remote host."
                         "An existing connection was forcibly closed by the remote host."
        Messages: route dial with wrong token must be rejected

The embedded NATS server started successfully and shut down cleanly. The wrong-token route connection was rejected as intended, but Windows surfaced the rejection as WSAECONNRESET instead of nats.ErrAuthorization.

Root cause assessment

Classification: flaky/OS-specific test assertion.

ClusterAuthRequired dials the NATS cluster route listener with a normal nats.go client and requires the returned error to wrap natsgo.ErrAuthorization. That assumes the route listener always writes a client-protocol -ERR 'Authorization Violation' that nats.go parses before closing the socket.

On Windows, the server can close/reset the rejected route connection before the client reads a parseable protocol error. Winsock then reports wsarecv: An existing connection was forcibly closed by the remote host. The security behavior is correct—the wrong token was rejected—but the exact error-class assertion is not portable/stable for this route-protocol misuse.

Possible fixes:

  • treat a Windows connection reset as an accepted rejection outcome in this subtest;
  • assert that no route forms / the connection closes rather than requiring one exact nats.go client error;
  • or test route authentication through a route-protocol-aware mechanism/server callback instead of connecting a normal NATS client to the cluster port.

Race, panic, OOM, and resource checks

The full job log contains no Go race warning, panic, OOM, killed process, allocation failure, disk exhaustion, or file-descriptor exhaustion indicator. This is unrelated to the NATS shutdown panic tracked in coder/internal#1631.

Assignment analysis

Ownership/history targets:

git blame -L 500,530 coderd/x/nats/pubsub_internal_test.go
git log --oneline -10 --follow coderd/x/nats/pubsub_internal_test.go

The exact ClusterAuthRequired subtest and its require.ErrorIs(..., natsgo.ErrAuthorization) assertions were introduced together in 167ac7b8 (feat: add nats experiment, PR coder/coder#25703) by sreya. Later changes modified other NATS tests or only increased cluster TLS timeout; they did not alter this assertion.

Assigning sreya based on exact test-line ownership, not the failing CI commit author.

Duplicate search

Searched open and closed coder/internal issues, including the last 30 days, for:

  • TestPubsubCluster/ClusterAuthRequired and TestPubsubCluster;
  • nats: authorization violation, wrong-token route auth, and pubsub_internal_test.go;
  • An existing connection was forcibly closed by the remote host / wsarecv;
  • NATS Windows failures, process crashes, panic/OOM/unknown failures, and race signatures.

No issue describes this test and failure mode.

Related but not duplicate:

Reproduction

go test ./coderd/x/nats -run '^TestPubsubCluster/ClusterAuthRequired$' -count=100

Run on Windows; full-suite socket churn may increase occurrence frequency.

主要言語
言語のデータがありません
スター
3
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

coder/internal のほかの issue

coder/internal の issue をすべて見る

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

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