remote-worker: TestCapRefusalsAreBoundedPerVM flakes under -race (samples capRefusalsInFlight before the accept loop registers)

Cerrado Apto para principiantes
#650 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend, testing

Línea de trabajo

Lee remote-worker/internal/egress/proxy_test.go, en especial TestCapRefusalsAreBoundedPerVM alrededor de las líneas 521–530 y el patrón de sondeo en TestCapRefusalPastTheBoundClosesWithoutDraining alrededor de la línea 552. Ejecuta la prueba específica con -race para reproducir el fallo de sincronización. Se considerará terminado cuando la prueba espere a que se registre un rechazo antes de medir el máximo y pase de forma fiable con -race.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

TestCapRefusalsAreBoundedPerVM (remote-worker/internal/egress/proxy_test.go) flakes under -race: observed 1 in 3 at moca@1b76333 while re-reviewing #647.

Failure:

proxy_test.go:530: no refusal was ever in flight: the test did not exercise the refusal path

Cause

The test offers CONNECTs and samples h.capRefusalsInFlight("vm-1") immediately after each write (proxy_test.go:521), without waiting for the proxy's accept loop to register the refusal. Under -race scheduling every sample can be taken before any refusal is registered, so peak stays 0 and the test fails its own vacuity check (peak == 0) rather than the bound it means to pin.

Context

Found while re-reviewing #647: proto went red twice on that head before passing. The other red was the guestagent EgressForwarder.logf data race, which open PR #645 fixes. This test is untouched by #647 and is a separate defect.

Fix sketch

After offering a refusal, wait for it to register before sampling for the peak — poll capRefusalsInFlight (as TestCapRefusalPastTheBoundClosesWithoutDraining already does at proxy_test.go:552) or otherwise synchronize with the accept loop — instead of sampling opportunistically between writes.

Lenguaje dominante
TypeScript
Estrellas
5
Forks
11
Merge medio
8 h 32 min
PR fusionados (30 d)
166

Preparar el entorno

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 rossoctl/moca

Todos los issues de rossoctl/moca

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.