Fix bug in terminating a failed pipeline

This commit is contained in:
hesham 2022-03-15 11:28:17 -04:00
parent a7b2ef770e
commit 3d16a4dee2
3 changed files with 8 additions and 5 deletions

View File

@ -58,8 +58,10 @@ Status TreeConsumer::Init(std::shared_ptr<DatasetNode> d) {
}
Status TreeConsumer::Terminate() {
CHECK_FAIL_RETURN_UNEXPECTED(tree_adapter_->AllTasks() != nullptr, " Execution tree has not been built");
return tree_adapter_->AllTasks()->ServiceStop();
if (tree_adapter_->AllTasks() != nullptr) {
return tree_adapter_->AllTasks()->ServiceStop();
}
return Status::OK();
}
#ifndef ENABLE_SECURITY

View File

@ -14,15 +14,16 @@
# ============================================================================
"""
@File : conftest.py
@Desc : common fixtures for pytest
@Desc : common fixtures for pytest dataset
"""
import pytest
from mindspore.dataset.engine.iterators import _cleanup, _unset_iterator_cleanup
@pytest.fixture(autouse=True)
@pytest.fixture(scope="function", autouse=True)
def close_iterators():
yield
# Note: code after `yield` is teardown code
_cleanup()
_unset_iterator_cleanup()

View File

@ -209,7 +209,7 @@ def test_reset_mindrecord(add_and_remove_cv_file): # pylint: disable=unused-arg
run_reset(data, num_epochs=num_epochs, failure_point=failure_point, reset_step=reset_step)
def skip_test_reset_np_error():
def test_reset_np_error():
"""
Feature: dataset recovery
Description: Simple test of data pipeline reset feature for error cases (step is negative, or larger than expected)