Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG]: Flaky test – TestMatchmakingService fails intermittently (users matched before pool assertion)

Open Beginner friendly
#760 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
testing

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
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
  1. cd backend
  2. Run the test several times to hit the race:
    go test ./services/ -run TestMatchmakingService -count=10 -v
    
  3. 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
Image
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/DebateAI

All issues in AOSSIE-Org/DebateAI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.