Skip to content

Fix _FakeDoneEvent.signal_evt class-state leakage between XMPP tests#1529

Merged
caronc merged 2 commits intoxmpp-test-race-condition-fixfrom
copilot/sub-pr-1526-another-one
Feb 20, 2026
Merged

Fix _FakeDoneEvent.signal_evt class-state leakage between XMPP tests#1529
caronc merged 2 commits intoxmpp-test-race-condition-fixfrom
copilot/sub-pr-1526-another-one

Conversation

Copy link

Copilot AI commented Feb 20, 2026

_FakeDoneEvent.signal_evt was set via direct class attribute assignment in three timeout-path tests, leaving stale state that could affect subsequent tests depending on execution order.

Changes

  • Replace all three _FakeDoneEvent.signal_evt = ... direct assignments with monkeypatch.setattr() so pytest's monkeypatch fixture automatically restores the attribute to its original None after each test
# Before — class state persists after test completes or fails
_FakeDoneEvent.signal_evt = client_created

# After — automatically restored by monkeypatch teardown
monkeypatch.setattr(_FakeDoneEvent, "signal_evt", client_created)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: caronc <850374+caronc@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test to prevent XMPP racing condition failures Fix _FakeDoneEvent.signal_evt class-state leakage between XMPP tests Feb 20, 2026
Copilot AI requested a review from caronc February 20, 2026 20:31
@caronc caronc marked this pull request as ready for review February 20, 2026 20:47
@caronc caronc merged commit 175027a into xmpp-test-race-condition-fix Feb 20, 2026
2 checks passed
@caronc caronc deleted the copilot/sub-pr-1526-another-one branch February 20, 2026 21:19
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.

2 participants