[BUG]: Flaky test – TestMatchmakingService fails intermittently (users matched before pool assertion)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
Research direction
Start with backend/services/matchmaking_test.go and the TestMatchmakingService setup, then run cd backend && go test ./services/ -run TestMatchmakingService -count=10 -v from the backend directory. Make the test deterministic by preventing the users from matching before the pool assertion or by asserting the matchmaking outcome directly, without changing production logic. The change is complete when the test passes repeatedly under the repeated test command and no longer depends on goroutine timing.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 104
- Forks
- 244
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 42
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/DebateAI
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
AOSSIE-Org/DebateAI#773 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
AOSSIE-Org/DebateAI#772 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG]: Header avatar and display name don't update after editing the profilePossibly taken @mithunkc017-ship-it claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
AOSSIE-Org/DebateAI#770 · 2 comments ·
Maintainers usually reply within 1 day
-
[BUG]: Signed-out visitors see a fake account menu ("User", "No email", "Sign out") on public pagesPossibly taken @dhruvbit claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/DebateAI#769 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
AOSSIE-Org/DebateAI#768 · 1 comment ·
Maintainers usually reply within 1 day
All issues in AOSSIE-Org/DebateAI
Similar issues
-
a10y a10y-audit ai-driven-qa claude
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
linagora/twake-directory-manager#219 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
0️⃣ phase/new
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Pulse v7: buildPreferencesFromTelos() bypasses telosSectionOrFile(), renders empty on unified-TELOS installsPossibly taken @zephyr91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2393 ·
Maintainers usually reply within 4 days