Skip to content

Improve Wikidata test resiliency with retries and backoff#777

Merged
adulau merged 1 commit into
mainfrom
codex/improve-test_wikidata-to-add-retry-logic
May 24, 2026
Merged

Improve Wikidata test resiliency with retries and backoff#777
adulau merged 1 commit into
mainfrom
codex/improve-test_wikidata-to-add-retry-logic

Conversation

@adulau

@adulau adulau commented May 24, 2026

Copy link
Copy Markdown
Member

Motivation

  • Reduce flakiness of the Wikidata expansion test by retrying transient failures and avoiding immediate test failures when the Wikidata endpoint (or the local proxy) is temporarily unreachable or rate-limited.

Description

  • Added an import of time and updated tests/test_expansions.py to implement a retry/backoff loop for test_wikidata with max_attempts = 4 and wait_seconds = 2.
  • The new test_wikidata catches and retries on requests.exceptions.RequestException and treats specific server-side error messages as retryable before failing the test.
  • Preserves the original acceptable outcomes ("http://www.wikidata.org/entity/Q95", "No additional data found on Wikidata", and the server error message) while reducing false negatives from transient network/API issues.

Testing

  • Ran pytest -q tests/test_expansions.py -k test_wikidata in this environment, which failed due to the local service being unreachable (Connection refused to 127.0.0.1:6666), indicating the failure is environmental and not caused by the test logic changes.

Codex Task

@adulau adulau merged commit 92c10dc into main May 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant