fix: flaky testProviderSearchWhitelist test - #5416
Merged
blackheaven merged 2 commits intoAug 5, 2026
Merged
Conversation
randomString in integration/test/API/Common.hs used bare randomIO (full Unicode range, including surrogate code points U+D800-U+DFFF). When the random service-name prefix contained a surrogate, it diverged across two transports: Text.pack (JSON body / name path) replaced it with U+FFFD, while URL byte percent-encoding (query prefix path) emitted raw WTF-8 bytes. The server's Text.isPrefixOf match then failed, filtering out all services and returning services: []. Constrain randomString to the alphanumeric alphabet [A-Za-z0-9] via the existing mkArray/pick idiom (matching randomName and every sibling helper in the same file), eliminating non-scalar code points at the source. This also closes a latent ordering flake: the old full-range Char could emit code points below '0', which would break the "0000000000|..." sorts-first assertion.
Revert the over-broad constraint on the shared `randomString` (c0cc978) back to its original full-range `randomIO` form, restoring original fuzz behavior for the other callers (test passwords, `randomJSON`). Add a dedicated `randomAlphaString` ([A-Za-z0-9]) and use it only at the `namePrefix` call site of `testProviderSearchWhitelist` — the sole value that crosses both transports: a JSON service-name body (`Text.pack`) and a URL search-prefix query param (percent-encoding). Full-range `Char` can include surrogate code points that the two transports map differently (WTF-8 bytes vs one U+FFFD per surrogate), so the reconstructed prefix is no longer a prefix of the stored names and the search returns 0/20 services — the flake. Leaves `serviceSuffix` on `randomString` since it is JSON-body-only.
Contributor
|
Please come up with a more precise and less chatty commit message when you squash and merge this 😸 |
blackheaven
deleted the
gdifolco/fix-flaky-tests-provider-search-whitelist
branch
August 5, 2026 06:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
changelog.d