Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[TESTS] Fix rerun mechanism in case of failed tracing (#26758)

Maxim Vafin416bfb44b054
diff --git a/tests/layer_tests/py_frontend_tests/test_torchvision_preprocessor.py b/tests/layer_tests/py_frontend_tests/test_torchvision_preprocessor.py
index 78bd4d526dd..ea731d4a7ae 100644
--- a/tests/layer_tests/py_frontend_tests/test_torchvision_preprocessor.py
+++ b/tests/layer_tests/py_frontend_tests/test_torchvision_preprocessor.py
@@ -36,7 +36,7 @@ def _infer_pipelines(test_input, preprocess_pipeline, input_channels=3):
try:
return _infer_pipelines_impl(test_input, preprocess_pipeline, input_channels)
except RuntimeError as e:
- if "builtin cannot be used as a value" in e:
+ if "builtin cannot be used as a value" in str(e):
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1
diff --git a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
index 2481f1d65ef..a2f54076de9 100644
--- a/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
+++ b/tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
@@ -76,7 +76,7 @@ class PytorchLayerTest:
try:
return self._test_impl(model, ref_net, kind, ie_device, precision, ir_version, infer_timeout, dynamic_shapes, **kwargs)
except RuntimeError as e:
- if "builtin cannot be used as a value" in e:
+ if "builtin cannot be used as a value" in str(e):
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1