Skip to content

Commit

Permalink
[TESTS] Remove restart condition as it happens in nested exception (o…
Browse files Browse the repository at this point in the history
…penvinotoolkit#27012)

### Details:
- *Will restart any `RuntimeError` as the searching text in the
exception class is not reliable enough*

### Tickets:
 - *CVS-151277*
  • Loading branch information
mvafin authored Oct 11, 2024
1 parent ec466ac commit 50f78fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ 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 str(e):
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1
else:
raise
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1
else:
print("Max retries reached. Function execution failed.")

Expand Down
9 changes: 3 additions & 6 deletions tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,9 @@ def _test(self, model, ref_net, kind, ie_device, precision, ir_version, infer_ti
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 str(e):
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1
else:
raise
# This is a potentially sporadic issue
print(f"An error occurred: {e}. Retrying...")
retries += 1
else:
print("Max retries reached. Function execution failed.")

Expand Down

0 comments on commit 50f78fd

Please sign in to comment.