Skip to content

Retry the upload and first poll in test_target_summary - #3563

Merged
adamtheturtle merged 3 commits into
mainfrom
adamtheturtle/fix-issue-3354
Sep 7, 2026
Merged

adamtheturtle merged 3 commits into
mainfrom
adamtheturtle/fix-issue-3354

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #3354.

test_target_summary asserted tracking_rating == -1 from one summary report taken immediately after adding a target. The real VWS reports -1 for only a short time after an upload before publishing the image's rating while the target is still processing, so a single immediate poll can miss the window and see the settled rating instead. Because AssertionError is not retried by pytest-retry, this made the Real Vuforia job red whenever it happened.

The assertion stays strict. The upload and first poll now live in a helper which is retried with tenacity on AssertionError, up to five attempts, uploading a fresh target each time. A rating never returns to -1 once it has left it, so polling the same target again would be no use. A comment on the helper explains the window and why the retry is there, and notes that this makes a miss unlikely rather than impossible.

Ran tests/mock_vws/test_target_summary.py against the in-memory mock, the in-memory Docker application, and Real Vuforia locally: 20 passed. Also exercised the retry path with a stub client to confirm it re-uploads a fresh target and reraises after the attempts are exhausted.

🤖 Generated with Claude Code

The real VWS reports -1 for only a short time after an upload before
publishing the image's rating while still processing. A single poll
straight after the add can miss that window, which made the Real
Vuforia parametrisation flaky.

Fixes #3354

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Rather than loosening the assertion, keep asserting -1 and retry the
whole upload and first poll with a fresh target when the window is
missed. A rating never returns to -1, so polling the same target again
would not help.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@adamtheturtle adamtheturtle changed the title Accept a settled tracking rating in test_target_summary Retry the upload and first poll in test_target_summary Sep 7, 2026
The vws client already seeks to the start of the stream before reading
it and restores the position afterwards, so a retried upload reuses the
stream without help from the test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch was previously deployed

2 inactive deployments
development — 19d184a8 Deployed Sep 7, 2026 by adamtheturtle via pages #1967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_target_summary fails against Real Vuforia with a tracking rating of 0

1 participant