Let two runs of the fixed-port metrics test share a machine

Aperta
#2,906 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
testing

Direzione di ricerca

Read tests/metrics/fixed_ports.rs and the random loopback helper added in #2393, then reproduce the collision by running the built test binary twice concurrently. Confirm the approach in the spec review, update the test and document why the ports remain fixed. Run 20 paired executions and confirm both runs pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Parent EPIC: #2392

Goal

Two concurrent runs of the metrics-fixed-ports integration test on one machine both pass. The test keeps covering tracker listeners on fixed ports.

Background

The shared-resource audit (#2394, finding P2) found that tests/metrics/fixed_ports.rs starts the tracker with four listeners on fixed ports: 0.0.0.0:17091 and 17092 (HTTP), 17093 and 17094 (UDP). Within one suite run nothing else uses them, but a second run of the same test binary on the same machine binds the same addresses, and its tracker fails to start with AddrInUse.

Running the built test binary twice at the same time, 20 times, failed one of the two runs in every pair. This happens today on development machines where several AI agents run the suite on the host network. On the self-hosted runner the test runs inside docker build, where each build step has its own network namespace, so concurrent builds do not collide.

Candidate approach (to confirm in spec review)

Bind the four fixed ports on a random loopback address from torrust_tracker_test_helpers::random::loopback_ipv4() (added in #2393) instead of 0.0.0.0, so two runs use different addresses with the same ports; ignore the test off Linux. This extends the helper beyond the nine #2393 tests, which needs a maintainer decision in the EPIC. Another option is deleting the test if metrics-port-zero already covers the same contract.

Tasks

  • Reproduce the paired-run collision on current develop.
  • Change the test so concurrent runs do not collide, and document why the ports are fixed.
  • Recheck with 20 paired runs.

The full specification is added to docs/issues/open/ by a spec-only pull request.

Lingua principale
Rust
Stelle
532
Fork
56
Merge medio
11h 20m
PR unite (30g)
282

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di torrust/torrust-tracker

Tutte le issue di torrust/torrust-tracker

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.