Skip to content

Conversation

juliusgeo
Copy link
Contributor

No description provided.

@ShaneHarvey
Copy link
Member

Looks like this test is failing on pypy 3.8:

FAIL: test_implicit_sessions_checkout (test_session.TestSession)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/mongo-python-driver/mongo-python-driver/test/test_session.py", line 220, in test_implicit_sessions_checkout
    self.assertTrue(succeeded)

Could be related to delayed garbage collection in pypy? Does it also fail locally for you?

@blink1073
Copy link
Member

I think we should only do the manual gc collect if we detect we're on PyPy: import platform; "PyPy" in platform.python_implementation(). https://stackoverflow.com/q/45685549

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Still waiting for an explanation for why changing from $listLocalSessions to client.admin.aggregate, [[{"$currentOp": {}}]] fixes the test failure on pypy. Is there a bug in our CommandCursor implementation? Does $listLocalSessions require multiple batches whereas $currentOp is a single batch? A multi-batch cursor would cause this test to almost always create one extra session since the session needs to be kept alive until all batches complete. In this case I believe we should update the test to impose a limit=1 for all find/aggregate cursors.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

LGTM

@juliusgeo juliusgeo merged commit b737b84 into mongodb:master Mar 1, 2022
juliusgeo added a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 5, 2022
juliusgeo added a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 7, 2022
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.

3 participants