(cls)
| 7286 | |
| 7287 | @classmethod |
| 7288 | def tearDownClass(cls): |
| 7289 | # only the manager process should be returned by active_children() |
| 7290 | # but this can take a bit on slow machines, so wait a few seconds |
| 7291 | # if there are other children too (see #17395) |
| 7292 | timeout = WAIT_ACTIVE_CHILDREN_TIMEOUT |
| 7293 | start_time = time.monotonic() |
| 7294 | for _ in support.sleeping_retry(timeout, error=False): |
| 7295 | if len(multiprocessing.active_children()) <= 1: |
| 7296 | break |
| 7297 | else: |
| 7298 | dt = time.monotonic() - start_time |
| 7299 | support.environment_altered = True |
| 7300 | support.print_warning(f"multiprocessing.Manager still has " |
| 7301 | f"{multiprocessing.active_children()} " |
| 7302 | f"active children after {dt:.1f} seconds") |
| 7303 | |
| 7304 | gc.collect() # do garbage collection |
| 7305 | if cls.manager._number_of_objects() != 0: |
| 7306 | # This is not really an error since some tests do not |
| 7307 | # ensure that all processes which hold a reference to a |
| 7308 | # managed object have been joined. |
| 7309 | test.support.environment_altered = True |
| 7310 | support.print_warning('Shared objects which still exist ' |
| 7311 | 'at manager shutdown:') |
| 7312 | support.print_warning(cls.manager._debug_info()) |
| 7313 | cls.manager.shutdown() |
| 7314 | cls.manager.join() |
| 7315 | cls.manager = None |
| 7316 | |
| 7317 | super().tearDownClass() |
| 7318 | |
| 7319 | |
| 7320 | class ThreadsMixin(BaseMixin): |
nothing calls this directly
no test coverage detected