[BUG]: Flaky test – TestMatchmakingService fails intermittently (users matched before pool assertion)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 92/100
Direzione di ricerca
Inizia con backend/services/matchmaking_test.go e la configurazione di TestMatchmakingService, quindi esegui cd backend && go test ./services/ -run TestMatchmakingService -count=10 -v dalla directory backend. Rendi il test deterministico impedendo che gli utenti venga accoppiati prima dell’asserzione sul pool oppure verificando direttamente il risultato del matchmaking, senza modificare la logica di produzione. La modifica è completa quando il test passa ripetutamente con il comando di test ripetuto e non dipende più dal timing delle goroutine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
TestMatchmakingService in backend/services/matchmaking_test.go fails intermittently. This is a bug in the test, not in the matchmaking logic.
StartMatchmaking launches findMatch in a background goroutine. The test uses two users with Elo 1200 and 1250, which are within the ±200 match range, so the matcher can pair them and remove both from the pool before the test checks for 2 users. Whether the test passes depends on goroutine timing, so it fails on some machines and passes on others (including CI).
Proposed fix: make the test deterministic without changing the matchmaking logic, e.g. use Elo values outside the match range (1200 vs 2000), or assert on the match outcome instead of the pool size. I'd like to work on this.
Steps to Reproduce
cd backend- Run the test several times to hit the race:
go test ./services/ -run TestMatchmakingService -count=10 -v - Some runs fail with
Expected 2 users in pool after both started matchmaking, got 0.
Logs and Screenshots
--- FAIL: TestMatchmakingService (0.00s)
matchmaking_test.go:50: Expected 2 users in pool after both started matchmaking, got 0
matchmaking_test.go:57: Expected 1 user in pool after removal, got 0
matchmaking_test.go:64: Expected 1 user in pool after activity update, got 0
FAIL
FAIL arguehub/services 2.238s
Environment Details
- OS: Windows 11 (Git Bash)
- Go
- Branch: latest
main - Only the backend test suite is affected; the app and deployment are not.
Impact
Low - Minor inconvenience
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Lingua principale
- TypeScript
- Stelle
- 104
- Fork
- 244
- Merge medio
- 1g 21h
- PR unite (30g)
- 43
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/DebateAI
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
AOSSIE-Org/DebateAI#773 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
AOSSIE-Org/DebateAI#772 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Header avatar and display name don't update after editing the profileForse già presa @mithunkc017-ship-it l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
AOSSIE-Org/DebateAI#770 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Signed-out visitors see a fake account menu ("User", "No email", "Sign out") on public pagesForse già presa @dhruvbit l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/DebateAI#769 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
AOSSIE-Org/DebateAI#768 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AOSSIE-Org/DebateAI
Issue simili
-
category::task code priority::normal
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
e0ipso/strikethroo#145 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
cocos/cocos-docs#3333 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
RevenueCat/react-native-purchases#2079 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RevenueCat/purchases-hybrid-common#2039 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-reported area/react bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno