Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/fm-azure-worker-provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ def resource_record(kind, value, power_state=None, tags_override=None):

def azure_resource_not_found(stderr):
return bool(re.search(
r"(?:\((?:ResourceNotFound|ParentResourceNotFound|ContainerNotFound)\)"
r"(?:\((?:NotFound|ResourceNotFound|ParentResourceNotFound|ContainerNotFound)\)"
r"|^(?:Code|ErrorCode):\s*"
r"(?:ResourceNotFound|ParentResourceNotFound|ContainerNotFound)\s*$)",
r"(?:NotFound|ResourceNotFound|ParentResourceNotFound|ContainerNotFound)\s*$)",
str(stderr or ""), re.MULTILINE,
))

Expand Down
3 changes: 3 additions & 0 deletions tests/fm-worker-lifecycle.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9247,6 +9247,8 @@ def exact_read(_controller, args, check=False, timeout=provider.AZ_TIMEOUT_SECON
}, 0, ""
if args[:3] == ["storage", "container", "show"]:
return None, 1, "ErrorCode:ContainerNotFound"
if args[:2] == ["disk", "show"] and args[args.index("--name") + 1] == "disk-fixture-wkr-02-task":
return None, 1, "ERROR: (NotFound) Disk disk-fixture-wkr-02-task is not found.\nCode: NotFound\nMessage: Disk disk-fixture-wkr-02-task is not found."
return None, 1, "(ResourceNotFound) exact fixture absence"

provider.az = exact_read
Expand All @@ -9263,6 +9265,7 @@ assert not any("list" in call[:3] for call in calls), calls
assert any(call[:2] == ("vm", "show") for call in calls), calls
assert any(call[:2] == ("network", "nic") for call in calls), calls
assert sum(call[:2] == ("disk", "show") for call in calls) == 3, calls
assert "task-disk" not in snapshot["workers"][0]["resources"], snapshot
assert snapshot["capacity_reservations"] == []
assert snapshot["metrics"]["actual_usd"] is None
try:
Expand Down