MCPcopy Index your code
hub / github.com/RustPython/RustPython / tearDownClass

Method tearDownClass

Lib/test/_test_multiprocessing.py:6658–6687  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

6656
6657 @classmethod
6658 def tearDownClass(cls):
6659 # only the manager process should be returned by active_children()
6660 # but this can take a bit on slow machines, so wait a few seconds
6661 # if there are other children too (see #17395)
6662 timeout = WAIT_ACTIVE_CHILDREN_TIMEOUT
6663 start_time = time.monotonic()
6664 for _ in support.sleeping_retry(timeout, error=False):
6665 if len(multiprocessing.active_children()) <= 1:
6666 break
6667 else:
6668 dt = time.monotonic() - start_time
6669 support.environment_altered = True
6670 support.print_warning(f"multiprocessing.Manager still has "
6671 f"{multiprocessing.active_children()} "
6672 f"active children after {dt:.1f} seconds")
6673
6674 gc.collect() # do garbage collection
6675 if cls.manager._number_of_objects() != 0:
6676 # This is not really an error since some tests do not
6677 # ensure that all processes which hold a reference to a
6678 # managed object have been joined.
6679 test.support.environment_altered = True
6680 support.print_warning('Shared objects which still exist '
6681 'at manager shutdown:')
6682 support.print_warning(cls.manager._debug_info())
6683 cls.manager.shutdown()
6684 cls.manager.join()
6685 cls.manager = None
6686
6687 super().tearDownClass()
6688
6689
6690class ThreadsMixin(BaseMixin):

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
superClass · 0.85
collectMethod · 0.80
_number_of_objectsMethod · 0.80
_debug_infoMethod · 0.80
shutdownMethod · 0.45
joinMethod · 0.45
tearDownClassMethod · 0.45

Tested by

no test coverage detected