Make tests deterministic and independent of global state

Aperta
#90 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 9 giorni

@Goldloli ci sta già lavorando.

Dal 2/11/2026.

  • #161 di @Goldloli — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
matplotlib, numpy, python
Ambito
testing-qa

Direzione di ricerca

Start by locating the listed planners and filters, especially informed_rrt_star_path_planner.py, and inspect their random number and matplotlib setup; then review the test layout to see how tests are run. Add the test-level setup described in the issue and remove constructor changes to global state. Done means repeated test runs are deterministic and all tests pass on CI.

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

Descrizione

enhancement

Problem

  • RRT, RRT*, bidirectional RRT*, particle filter, GNSS noise, EKF/UKF and MPPI use unseeded random numbers. A planner that fails to find a path makes the smoke test fail or hang by chance.
  • informed_rrt_star_path_planner.py calls matplotlib.use(...) and np.random.seed(42) inside its constructor, which changes global state for every later test in the same process.
  • CI doesn't set a non-interactive matplotlib backend.

Expected fix

  • Add test/conftest.py that sets the Agg backend and fixes the random seed for each test
  • Remove matplotlib.use and np.random.seed from component constructors

Done when

Repeated test runs give the same results and all tests pass on CI.

Lingua principale
Python
Stelle
1.9k
Fork
313
Merge medio
9g 10h
PR unite (30g)
7

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 ShisatoYano/AutonomousVehicleControlBeginnersGuide

Tutte le issue di ShisatoYano/AutonomousVehicleControlBeginnersGuide

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.