Skip to content

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Mar 15, 2022

This change avoids false positives for the main client_context client. I also changed the output to be a little more readable. When the check finds a real problem, the new output looks like this:

pypy3 setup.py test -s test.test_client.TestClient
...
test_waitQueueTimeoutMS (test.test_client.TestClient) ... ok
----------------------------------------------------------------------
Ran 57 tests in 19.489s

OK (skipped=9)
WARNING: found Topology with running threads:
  Threads: [<PeriodicExecutor(name=pymongo_server_monitor_thread) object at 0x7facb8231248>, <PeriodicExecutor(name=pymongo_server_rtt_thread) object at 0x7facb8231328>]
  Topology: <Topology <TopologyDescription id: 6230fe16efe40a2b8ad01304, topology_type: ReplicaSetWithPrimary, servers: [<ServerDescription ('localhost', 27017) server_type: RSPrimary, rtt: 0.007118122831045185>]>>
  Creation traceback:
  File "setup.py", line 345, in <module>
    **extra_opts
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/site-packages/setuptools-54.2.0-py3.7.egg/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 122, in run
    result = runner.run(suite)
  File "/Users/shane/git/mongo-python-driver/test/__init__.py", line 1095, in run
    result = super(PymongoTestRunner, self).run(test)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/unittest/runner.py", line 176, in run
    test(result)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/unittest/suite.py", line 122, in run
    test(result)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/unittest/case.py", line 676, in __call__
    return self.run(*args, **kwds)
  File "/usr/local/Cellar/pypy3/7.3.4/libexec/lib-python/3/unittest/case.py", line 628, in run
    testMethod()
  File "/Users/shane/git/mongo-python-driver/test/__init__.py", line 556, in wrap
    return f(*args, **kwargs)
  File "/Users/shane/git/mongo-python-driver/test/test_client.py", line 1279, in test_exhaust_network_error
    client = rs_or_single_client(maxPoolSize=1, retryReads=False)
  File "/Users/shane/git/mongo-python-driver/test/utils.py", line 565, in rs_or_single_client
    return _mongo_client(h, p, **kwargs)
  File "/Users/shane/git/mongo-python-driver/test/utils.py", line 529, in _mongo_client
    return MongoClient(uri, port, **client_options)
  File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", line 785, in __init__
    srv_max_hosts=srv_max_hosts,
  File "/Users/shane/git/mongo-python-driver/pymongo/settings.py", line 77, in __init__
    self._stack = "".join(traceback.format_stack())

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!

@ShaneHarvey ShaneHarvey merged commit 9ada654 into mongodb:master Mar 15, 2022
@ShaneHarvey ShaneHarvey deleted the PYTHON-3174 branch March 15, 2022 21:54
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 5, 2022
juliusgeo pushed 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.

2 participants