Skip to content

Unsilenced flaky test_duplicate_media_context_creation#1252

Merged
jamesbraza merged 2 commits intomainfrom
more-flaky-tests
Dec 22, 2025
Merged

Unsilenced flaky test_duplicate_media_context_creation#1252
jamesbraza merged 2 commits intomainfrom
more-flaky-tests

Conversation

@jamesbraza
Copy link
Copy Markdown
Collaborator

Seen in this CI run:

>       assert (
            sum(
                district in session.answer
                for district in ("The Avenues", "Golden Gate", "Civic Center", "Haight")
            )
            >= 2
        ), "Expected at least two neighbors to be matched"
E       AssertionError: Expected at least two neighbors to be matched
E       assert 1 >= 2
E        +  where 1 = sum(<generator object test_duplicate_media_context_creation.<locals>.<genexpr> at 0x7f3da08f9560>)

This PR expands the assertion message so this can be debugged

@jamesbraza jamesbraza self-assigned this Dec 22, 2025
@jamesbraza jamesbraza added the bug Something isn't working label Dec 22, 2025
Copilot AI review requested due to automatic review settings December 22, 2025 15:18
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 22, 2025
@dosubot
Copy link
Copy Markdown

dosubot bot commented Dec 22, 2025

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the debugging experience for a flaky test by expanding an assertion error message to include the actual answer content. When the test_duplicate_media_context_creation test failed in CI, the assertion message only indicated that fewer than two districts were matched, but didn't show what the actual answer was, making it difficult to debug.

  • Enhanced assertion message to include the actual session.answer value using an f-string with repr formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jamesbraza jamesbraza merged commit 536ef08 into main Dec 22, 2025
6 of 7 checks passed
@jamesbraza jamesbraza deleted the more-flaky-tests branch December 22, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants