Fix flaky lost spec when fabricated user names collide - #249
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the flaky test seen in https://github.com/dblock/slack-gamebot/actions/runs/24003859108/job/70004221423.
Root Cause
In the
lost to two playerstests,winner,winner2, andloser2were fabricated without explicituser_namevalues. When Faker generates the same name for two of them (e.g. both getlester), the command parser resolveslost to lester lesteras a single player, producing:instead of the expected:
Fix
Assign distinct, explicit
user_namevalues (winner,winner2,loser2) to all fabricated users in the affected tests.