diff --git a/tests/ut/python/dataset/test_config.py b/tests/ut/python/dataset/test_config.py index 08b20a28fe9..7a12eff3139 100644 --- a/tests/ut/python/dataset/test_config.py +++ b/tests/ut/python/dataset/test_config.py @@ -21,6 +21,7 @@ import glob import numpy as np import mindspore.dataset as ds +import mindspore.dataset.engine.iterators as it import mindspore.dataset.transforms.py_transforms import mindspore.dataset.vision.c_transforms as c_vision import mindspore.dataset.vision.py_transforms as py_vision @@ -311,6 +312,10 @@ def test_deterministic_python_seed_multi_thread(): """ logger.info("test_deterministic_python_seed_multi_thread") + # Sometimes there are some ITERATORS left in ITERATORS_LIST when run all UTs together, + # and cause core dump and blocking in this UT. Add cleanup() here to fix it. + it._cleanup() # pylint: disable=W0212 + # Save original configuration values num_parallel_workers_original = ds.config.get_num_parallel_workers() seed_original = ds.config.get_seed()