Skip to content

Fix flaky RdapDomainSearchActionTest#3097

Merged
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:fix-rdap-test-flake
Jun 23, 2026
Merged

Fix flaky RdapDomainSearchActionTest#3097
CydeWeys merged 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

@CydeWeys CydeWeys requested a review from ptkach June 22, 2026 23:58
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 force-pushed the fix-rdap-test-flake branch from 18c351c to abed4bd Compare June 23, 2026 15:36

@ptkach ptkach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ptkach reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on CydeWeys).

@CydeWeys CydeWeys enabled auto-merge June 23, 2026 15:44
@CydeWeys CydeWeys added this pull request to the merge queue Jun 23, 2026
Merged via the queue into google:master with commit 6080cd2 Jun 23, 2026
16 checks passed
@CydeWeys CydeWeys deleted the fix-rdap-test-flake branch June 23, 2026 17:26
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.

2 participants