Skip to content

Make the retry, server choice and paging tests catch regressions - #1573

Merged
frenck merged 1 commit into
mainfrom
frenck/stronger-tests
Oct 1, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/stronger-tests

Conversation

@frenck

@frenck frenck commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Breaking change

None. Tests only.

Proposed change

Found in a review of the library: with coverage at 100%, a few tests still kept passing when the behavior they cover was broken. The review showed it by changing the code on purpose, and this tightens those tests until every such change fails one:

Change to the code Now caught by
Always use the first server instead of a random one test_host_lookup_picks_a_server
Retry without jitter test_retry_delays
languages() ignores limit test_list_params[languages]
tags() ignores limit test_list_params[tags]
search() ignores offset test_search_paging
  • The jitter test returns a distinct value from uniform() for each attempt, and checks both the bounds it is called with and that its value is the wait.
  • The server choice test makes random.choice pick the last candidate, and checks the candidate list (without the CNAME record) and the host the request actually goes to.
  • The new paging tests call languages(), tags() and search() with non-default paging and ordering, and check the query they send. countries() got the same check in Sort and page countries by their name #1568.

Type of change

  • Dependency or tooling upgrade
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Deprecation (replaces or removes a feature, with a migration path)
  • Breaking change (a fix or feature that changes existing behavior)
  • Code quality, refactor, or test-only change
  • Documentation only

Additional information

  • This PR fixes or closes issue: fixes # None
  • This PR is related to: None
  • Link to a separate documentation pull request: None

Checklist

  • I fully understand the code in this pull request and can explain every line, including any AI-assisted changes.
  • The change is covered by tests, and poetry run pytest passes locally. A pull request cannot be merged unless CI is green.
  • poetry run prek run --all-files passes (lint, format, and type checks).
  • No commented-out or dead code is left in the pull request.

A review showed several tests kept passing when the behavior they cover
was broken: retries without jitter, always using the first server, and
list methods ignoring their paging arguments. Assert the exact values
instead.
@frenck frenck added the maintenance Generic maintenance tasks. label Oct 1, 2026
@frenck
frenck merged commit 4a4a72d into main Oct 1, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Generic maintenance tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant