-
Type:
Build Failure
-
Resolution: Done
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Name of Failure:
test.test_monitor.TestMonitor.test_cleanup_executors_on_client_del
Link to task:
Context of when and why the failure occurred:
Stack trace:
[2025/04/08 06:16:51.689] FAILURE: AssertionError: Didn't ever unregister executor: pymongo_events_thread () [2025/04/08 06:16:51.689] self = <test.test_monitor.TestMonitor testMethod=test_cleanup_executors_on_client_del> [2025/04/08 06:16:51.689] def test_cleanup_executors_on_client_del(self): [2025/04/08 06:16:51.689] with warnings.catch_warnings(record=True) as w: [2025/04/08 06:16:51.689] warnings.simplefilter("always") [2025/04/08 06:16:51.689] client = self.create_client() [2025/04/08 06:16:51.689] executors = get_executors(client) [2025/04/08 06:16:51.689] self.assertEqual(len(executors), 4) [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] # Each executor stores a weakref to itself in _EXECUTORS. [2025/04/08 06:16:51.689] executor_refs = [(r, r()._name) for r in _EXECUTORS.copy() if r() in executors] [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] del executors [2025/04/08 06:16:51.689] del client [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] for ref, name in executor_refs: [2025/04/08 06:16:51.689] > wait_until(partial(unregistered, ref), f"unregister executor: {name}", timeout=5) [2025/04/08 06:16:51.689] test/test_monitor.py:74: [2025/04/08 06:16:51.689] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [2025/04/08 06:16:51.689] predicate = functools.partial(<function unregistered at 0x0000000017ef4660>, <weakref at 0x00000000107318c0; to 'PeriodicExecutor'>) [2025/04/08 06:16:51.689] success_description = 'unregister executor: pymongo_events_thread', timeout = 5 [2025/04/08 06:16:51.689] def wait_until(predicate, success_description, timeout=10): [2025/04/08 06:16:51.689] """Wait up to 10 seconds (by default) for predicate to be true. [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] E.g.: [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] wait_until(lambda: client.primary == ('a', 1), [2025/04/08 06:16:51.689] 'connect to the primary') [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] If the lambda-expression isn't true after 10 seconds, we raise [2025/04/08 06:16:51.689] AssertionError("Didn't ever connect to the primary"). [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] Returns the predicate's first true value. [2025/04/08 06:16:51.689] """ [2025/04/08 06:16:51.689] start = time.time() [2025/04/08 06:16:51.689] interval = min(float(timeout) / 100, 0.1) [2025/04/08 06:16:51.689] while True: [2025/04/08 06:16:51.689] if iscoroutinefunction(predicate): [2025/04/08 06:16:51.689] retval = predicate() [2025/04/08 06:16:51.689] else: [2025/04/08 06:16:51.689] retval = predicate() [2025/04/08 06:16:51.689] if retval: [2025/04/08 06:16:51.689] return retval [2025/04/08 06:16:51.689] [2025/04/08 06:16:51.689] if time.time() - start > timeout: [2025/04/08 06:16:51.689] > raise AssertionError("Didn't ever %s" % success_description) [2025/04/08 06:16:51.689] E AssertionError: Didn't ever unregister executor: pymongo_events_thread [2025/04/08 06:16:51.689] test/utils.py:77: AssertionError