Skip to content

PYTHON-6002 Increase wait_until timeout for test_heartbeat_awaited_flag on PyPy - #2987

Open
blink1073 wants to merge 1 commit into
mongodb:mainfrom
blink1073:PYTHON-6002
Open

PYTHON-6002 Increase wait_until timeout for test_heartbeat_awaited_flag on PyPy#2987
blink1073 wants to merge 1 commit into
mongodb:mainfrom
blink1073:PYTHON-6002

Conversation

@blink1073

@blink1073 blink1073 commented Aug 13, 2026

Copy link
Copy Markdown
Member

PYTHON-6002

Changes in this PR

test_heartbeat_awaited_flag was failing near-consistently on the pypy-3.11-ubuntu-latest GitHub Actions job (AssertionError: Didn't ever published failed event), and occasionally on evergreen hosts running PyPy. PyPy's JIT warm-up can delay the heartbeat monitor thread past the test's 10s wait_until timeout on slow CI runners.

  • Bump the timeout to 30s specifically on PyPy ("PyPy" in sys.version); other interpreters keep 10s.
  • Regenerated the sync mirror using just synchro.

Test Plan

  • Ran 15x locally under PyPy 3.11 against a local mongod — always passed, confirming the race isn't reproducible on demand (it's CI-resource dependent), so this is a timeout fix rather than a logic fix.
  • Ran pytest test/asynchronous/test_streaming_protocol.py test/test_streaming_protocol.py under both PyPy 3.11 and CPython — all pass.
  • just lint and just typing pass.
  • Make sure the all the pypy EVG tasks pass 2 times
  • Make sure the GitHub pypy job passes 2 times

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)? — not needed, test-only change.
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

…ag on PyPy

PyPy's JIT warm-up can delay the heartbeat monitor thread past the
default 10s wait_until timeout on slow/throttled CI runners, causing
near-consistent failures on the pypy-3.11-ubuntu-latest GitHub Actions
job. Bump the timeout to 30s specifically for PyPy; other interpreters
are unaffected.
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073
blink1073 marked this pull request as ready for review August 13, 2026 20:50
@blink1073
blink1073 requested a review from a team as a code owner August 13, 2026 20:50
@blink1073
blink1073 requested review from aclark4life and a lite review from Copilot August 13, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Reduces PyPy-specific flakiness in the streaming protocol heartbeat test by increasing the wait_until/async_wait_until timeout only when running under PyPy, keeping existing behavior unchanged for other interpreters.

Changes:

  • Add a PyPy-conditional timeout (30s on PyPy, 10s otherwise) for waiting on the failed heartbeat event.
  • Apply the change to the async test source and its regenerated synchronous mirror.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/asynchronous/test_streaming_protocol.py Uses a longer async_wait_until(..., timeout=...) on PyPy to avoid CI JIT warm-up delays.
test/test_streaming_protocol.py Sync mirror regeneration of the same PyPy-conditional timeout for wait_until.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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