!25640 fix minddata ut core

Merge pull request !25640 from luoyang/serving
This commit is contained in:
i-robot 2021-10-30 01:35:32 +00:00 committed by Gitee
commit b27520b6ae
1 changed files with 9 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import numpy as np
import pytest
import mindspore.dataset as ds
import mindspore.dataset.engine.iterators as it
from mindspore import log as logger
DATA_DIR = ["../data/dataset/testPyfuncMap/data.data"]
@ -321,6 +322,10 @@ def test_pyfunc_implicit_compose():
def test_pyfunc_exception():
logger.info("Test PyFunc Exception Throw: lambda x : raise Exception()")
# 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
def pyfunc(x):
raise Exception("Pyfunc Throw")
@ -355,6 +360,10 @@ def test_func_with_yield_manifest_dataset_01():
for i in range(10):
yield (np.array([i]),)
# 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
DATA_FILE = "../data/dataset/testManifestData/test.manifest"
data = ds.ManifestDataset(DATA_FILE)
data = data.map(operations=pass_func, input_columns=["image"], num_parallel_workers=1, python_multiprocessing=True,