diff --git a/inference-engine/src/inference_engine/ie_core.cpp b/inference-engine/src/inference_engine/ie_core.cpp index 2122fda276e..2143bafbccd 100644 --- a/inference-engine/src/inference_engine/ie_core.cpp +++ b/inference-engine/src/inference_engine/ie_core.cpp @@ -290,7 +290,9 @@ class Core::Impl : public ICore { networkIsImported = false; } catch (...) { cacheManager->removeCacheEntry(blobId); - throw; + networkIsImported = false; + // TODO: temporary disabled by #54335. In future don't throw only for new 'blob_outdated' exception + // throw; } return execNetwork; } diff --git a/inference-engine/tests/functional/inference_engine/caching_test.cpp b/inference-engine/tests/functional/inference_engine/caching_test.cpp index 5b9c334ce4b..4442e2ba361 100644 --- a/inference-engine/tests/functional/inference_engine/caching_test.cpp +++ b/inference-engine/tests/functional/inference_engine/caching_test.cpp @@ -644,8 +644,8 @@ TEST_P(CachingTest, TestCacheDirCreateRecursive) { }); } CommonTestUtils::removeFilesWithExt(newCacheDir2, "blob"); - std::remove(newCacheDir2.c_str()); - std::remove(newCacheDir1.c_str()); + CommonTestUtils::removeDir(newCacheDir2); + CommonTestUtils::removeDir(newCacheDir1); } TEST_P(CachingTest, TestDeviceArchitecture) { @@ -763,6 +763,8 @@ TEST_P(CachingTest, TestThrowOnExport) { } } +// TODO: temporary behavior is to no re-throw exception on import error (see 54335) +// In future add separate 'no throw' test for 'blob_outdated' exception from plugin TEST_P(CachingTest, TestThrowOnImport) { ON_CALL(*mockPlugin, ImportNetworkImpl(_, _, _)).WillByDefault(Throw(1)); ON_CALL(*mockPlugin, ImportNetworkImpl(_, _)).WillByDefault(Throw(1)); @@ -781,14 +783,14 @@ TEST_P(CachingTest, TestThrowOnImport) { }); } { - EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(0); - EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(0); + EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0); + EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0); EXPECT_CALL(*mockPlugin, ImportNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0); EXPECT_CALL(*mockPlugin, ImportNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0); - EXPECT_CALL(*net, ExportImpl(_)).Times(0); + EXPECT_CALL(*net, ExportImpl(_)).Times(1); testLoad([&](Core &ie) { ie.SetConfig({{CONFIG_KEY(CACHE_DIR), m_cacheDir}}); - EXPECT_ANY_THROW(m_testFunction(ie)); + EXPECT_NO_THROW(m_testFunction(ie)); }); } { // Step 3: same load, cache should be deleted due to unsuccessful import on step 2