Skip to content

test: Stabilize environment stream event assertions - #290

Open
Aditya030207 wants to merge 1 commit into
Flagsmith:mainfrom
Aditya030207:codex/isolate-streaming-update-tests
Open

Aditya030207 wants to merge 1 commit into
Flagsmith:mainfrom
Aditya030207:codex/isolate-streaming-update-tests

Conversation

@Aditya030207

Copy link
Copy Markdown

The streaming tests patch Flagsmith.update_environment for every client. A polling worker from another test can call that shared mock, causing a stale-event test to fail even when its own client skips the refresh.

Changes

  • Scope the mock to each client under test for newer, stale, and equal timestamps.

Closes #187

How did you test this code?

  • Forced another client to call update_environment during the stale-event assertion. This reproduced the failure before the patch and passed after it.
  • Passed all four streaming tests and all 408 tests on Python 3.12. The full macOS run used no_proxy='*' to avoid an unrelated native proxy lookup in a forked test process.

Review effort: 1/5

@Aditya030207
Aditya030207 requested a review from a team as a code owner November 27, 2026 13:37
@Aditya030207
Aditya030207 requested review from khvn26 and a balanced review from Copilot and removed request for a team November 27, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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.

test_environment_does_not_update_on_past_event is flaky

2 participants