Skip to content

Commit

Permalink
a shot at more graceful timeout recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
pevogam committed Jan 31, 2025
1 parent 50c9621 commit bec980d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions avocado_i2n/cartgraph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,10 +2123,9 @@ async def traverse_object_trees(
# despite ergodicity we ended at the same node (no other work)
if next in occupied_at:
if occupied_wait > test_duration:
raise RuntimeError(
f"Worker {worker.id} spent {occupied_wait:.2f} seconds waiting for "
f"occupied nodes of maximum test duration {test_duration:.2f}: "
+ ", ".join(n.id for n in occupied_at)
# allow reentrancy as best shot at recovering from an otherwise fatal error
next.params["max_concurrent_tries"] = (
self.params.get_numeric("max_concurrent_tries", 0) + 1
)
occupied_wait += occupied_timeout
else:
Expand Down
3 changes: 1 addition & 2 deletions selftests/isolation/test_cartesian_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2865,8 +2865,7 @@ def test_traverse_one_leaf_with_occupation_timeout(self):
{"shortname": "^internal.automated.on_customize.vm1", "vms": "^vm1$", "nets": "^net1$"},
]

with self.assertRaisesRegex(RuntimeError, r"^Worker .+ spent [\d\.]+ seconds waiting for occupied nodes"):
self._run_traversal(graph, {"test_timeout": "1"})
self._run_traversal(graph, {"test_timeout": "1"})

def test_traverse_two_objects_without_setup(self):
"""Test a two-object test traversal without a reusable setup."""
Expand Down

0 comments on commit bec980d

Please sign in to comment.