test(hardening): fix order-dependent tests surfaced by phased (ES→OS) runs (#36501)#36562
Open
fabrizzio-dotCMS wants to merge 1 commit into
Open
test(hardening): fix order-dependent tests surfaced by phased (ES→OS) runs (#36501)#36562fabrizzio-dotCMS wants to merge 1 commit into
fabrizzio-dotCMS wants to merge 1 commit into
Conversation
… runs (#36501) Two test-quality issues exposed by running the integration suite under a non-zero migration phase; neither is a product bug. - RelationshipFactoryImplTest.testGetDBRelatedChildrenMultilingualContent: the DB-focused test's setup relied on index read-after-write consistency (legacy- relationship checkin auto-preserves related content by reading the index). Under OS reads (phase 2) that dropped one related version (3 vs 4). Add waitForEmptyQueue() after the relationship is established so the language-variant check-ins see a consistent index. Verified under phase 2 (1/0/0). - ESSiteSearchAPITest.test_deleteOldSiteSearchIndices: used fixed index names with no cleanup, so a class retry collided on a leftover index (createSiteSearchIndex is fail-hard on already-exists). Use unique, strictly increasing timestamps per run (order preserved) so retries never collide. Verified under phase 2 (1/0/0). Note: PublisherTest.autoUnpublishContent (initially bucketed here as a flaky IdentifierDateJob race) is NOT included — re-firing the job with the correct content type on every poll still leaves the identifier's SysExpireDate null under phase 2, so it is deeper than a race (candidate product gap in the OS auto-expire path) and is being re-investigated separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 3m 9s —— View job PR Review: test-hardening (order-dependent tests, phase 2)
I reviewed both changed files against the production code paths they exercise. Verification notes
New IssuesNo issues found. Two small non-blocking observations (both pre-existing patterns, not introduced by this PR, so not flagged as findings):
This is a well-scoped, correctly-targeted test-hardening change. LGTM. |
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.
Proposed Changes
Two test-quality issues exposed by running the integration suite under a non-zero ES→OS migration phase (phase 2, reads from OpenSearch). Neither is a product bug. Contributes to #36501.
RelationshipFactoryImplTest.testGetDBRelatedChildrenMultilingualContent— the DB-focused test's setup relied on index read-after-write consistency: a legacy-relationship checkin with no explicit relationships auto-preserves related content by reading the index, and under OS reads (phase 2) that read isn't read-after-write consistent mid-test, dropping one related version (3 vs 4). AddedTestDataUtils.waitForEmptyQueue()after the relationship is established so the language-variant check-ins see a consistent index.ESSiteSearchAPITest.test_deleteOldSiteSearchIndices— used fixed index names with no cleanup, so a class retry (rerunFailingTestsCount) collided on a leftover index (createSiteSearchIndexis fail-hard on already-exists). Now uses unique, strictly increasing timestamps per run (relative order preserved).Verification
Both verified under phase 2 in an isolated worktree:
RelationshipFactoryImplTest1/0/0,ESSiteSearchAPITest1/0/0.Not included
PublisherTest.autoUnpublishContent(initially bucketed here as flaky) is excluded: re-firingIdentifierDateJobwith the correct content type on every poll still leaves the identifier'sSysExpireDatenull under phase 2 (deterministic across 4 reruns), so it is deeper than a race — a candidate product gap in the OS auto-expire path, being re-investigated separately under #36501.Refs #36501.