(self)
| 899 | check_state_structure( |
| 900 | actual, target, validation=CheckpointValidationType.CONTAINS_STATE_UP_TO_DTYPE |
| 901 | ) |
| 902 | |
| 903 | def test_stop(self): |
| 904 | mesh_shape = (1, 1) |
| 905 | if not test_utils.is_supported_mesh_shape(mesh_shape): |
| 906 | return |
| 907 | cfg = _checkpointer_config() |
| 908 | ckpt: Checkpointer = cfg.instantiate(parent=None) |
| 909 | # GC thread is not started until the start_gc_thread() call. |
| 910 | self.assertIsNone(ckpt._gc_thread) |
| 911 | |
| 912 | ckpt._start_gc_thread() |
| 913 | self.assertIsNotNone(ckpt._gc_thread) |
| 914 | ckpt.stop() |
| 915 | # GC thread is terminated after stop() returns. |
| 916 | self.assertIsNone(ckpt._gc_thread) |
| 917 | |
| 918 | # We can start gc and stop again. |
| 919 | ckpt._start_gc_thread() |
| 920 | self.assertIsNotNone(ckpt._gc_thread) |
| 921 | ckpt.stop() |
| 922 | self.assertIsNone(ckpt._gc_thread) |
| 923 |
nothing calls this directly
no test coverage detected