(cls)
| 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 | |
| 6690 | class ThreadsMixin(BaseMixin): |
nothing calls this directly
no test coverage detected