Skip to content

Fix flaky RdapDomainSearchActionTest#3097

Open
CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:fix-rdap-test-flake
Open

Fix flaky RdapDomainSearchActionTest#3097
CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:fix-rdap-test-flake

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Jun 22, 2026

Copy link
Copy Markdown
Member

Refactor RdapDomainSearchActionTest to dynamically resolve all domain and host Repository IDs (ROIDs) instead of asserting on hardcoded, sequence-generated strings (like "2E-LOL" or "6-LOL").

When tests are executed in parallel (as is common in CI environments like Kokoro), multiple test threads concurrently reset and allocate from the shared database sequence 'project_wide_unique_id_seq'. This interleaves ID allocations non-deterministically, causing any test asserting on exact, hardcoded sequence values to flake.

To fix this, createManyDomainsAndHosts was updated to return the list of persisted domains, allowing tests to dynamically resolve their ROIDs. All other test cases were refactored to dynamically fetch the ROIDs of pre-created domains and hosts (stored in fields or in hostNameToHostMap, using punycode keys for IDN hosts) for their JSON assertions, rendering the entire suite robust against sequence shifts.


This change is Reviewable

Refactor RdapDomainSearchActionTest to dynamically resolve all domain
and host Repository IDs (ROIDs) instead of asserting on hardcoded,
sequence-generated strings (like "2E-LOL" or "6-LOL").

When tests are executed in parallel (as is common in CI environments like
Kokoro), multiple test threads concurrently reset and allocate from the
shared database sequence 'project_wide_unique_id_seq'. This interleaves
ID allocations non-deterministically, causing any test asserting on
exact, hardcoded sequence values to flake.

To fix this, createManyDomainsAndHosts was updated to return the list of
persisted domains, allowing tests to dynamically resolve their ROIDs.
All other test cases were refactored to dynamically fetch the ROIDs of
pre-created domains and hosts (stored in fields or in hostNameToHostMap,
using punycode keys for IDN hosts) for their JSON assertions, rendering
the entire suite robust against sequence shifts.
@CydeWeys CydeWeys requested a review from ptkach June 22, 2026 23:58
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.

1 participant