Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

flake: TestPubsubCluster/ClusterAuthRequired

Abierto
#1,636 1 comentario 0 reacciones 1 asignado Ver en GitHub

@sreya ya está trabajando en esto.

Desde el 5/8/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
3
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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 coder/internal

Todos los issues de coder/internal

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.