Skip to content

Fix flaky lost spec when fabricated user names collide - #249

Merged
dblock merged 1 commit into
masterfrom
fix-lost-flaky-test
Apr 5, 2026
Merged

dblock merged 1 commit into
masterfrom
fix-lost-flaky-test

Conversation

@dblock

@dblock dblock commented Apr 5, 2026

Copy link
Copy Markdown
Owner

Fixes the flaky test seen in https://github.com/dblock/slack-gamebot/actions/runs/24003859108/job/70004221423.

Root Cause

In the lost to two players tests, winner, winner2, and loser2 were fabricated without explicit user_name values. When Faker generates the same name for two of them (e.g. both get lester), the command parser resolves lost to lester lester as a single player, producing:

lester defeated username and joye_konopelski

instead of the expected:

lester and lester defeated username and joye_konopelski

Fix

Assign distinct, explicit user_name values (winner, winner2, loser2) to all fabricated users in the affected tests.

When two users are fabricated without explicit user_name, Faker can
generate the same name for both. In 'lost to two players' tests,
if winner and winner2 get the same name, the command parser resolves
them as one player, causing the match message to drop one name.

Fix by assigning distinct explicit user_name values to winner, winner2,
and loser2 in the affected tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock merged commit 3493839 into master Apr 5, 2026
4 checks passed
@dblock
dblock deleted the fix-lost-flaky-test branch April 5, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant