test(index): make createContentIndexAndDelete index-count assertion phase-aware (#36501)#36517
Open
fabrizzio-dotCMS wants to merge 2 commits into
Open
test(index): make createContentIndexAndDelete index-count assertion phase-aware (#36501)#36517fabrizzio-dotCMS wants to merge 2 commits into
fabrizzio-dotCMS wants to merge 2 commits into
Conversation
…hase-aware (#36501) ContentletIndexAPIImplTest.createContentIndexAndDelete asserted an exact single-store delta (oldIndices + 2) after creating a working and live index. Under a dual-write migration phase (opensearch.phase=1/2) createContentIndex fans out to both the ES and OS stores, so listDotCMSIndices() reports two physical entries per logical index and the delta is +4, failing the assertion (observed "expected:<158> but was:<160>"). Assert the two created indices are present (already checked) and that the total grew by at least two, instead of a single-store exact delta. Passes in phase 0 (ES only) and under dual-write phases. Refs #36320 (ContentletIndexAPIImplTest phase-aware decoupling). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 2m 11s —— View job Claude finished @fabrizzio-dotCMS's task in 1m 4s —— View job PR Review — phase-aware
|
…erant (all phases) (#36501) The index-count assertion was made phase-tolerant in the previous commit, but the presence checks (foundWorking/foundLive) still compared against the raw index name ("working_<ts>"). Under OS-only phase 3, listDotCMSIndices() returns only the .os-tagged names (OSIndexAPIImpl.listIndices strips the cluster prefix but not the tag), so the raw-name equals() never matched and assertTrue(foundWorking) failed. In phases 1/2 it passed only incidentally because the ES provider also contributes the untagged name. Strip the vendor tag with IndexTag.strip(index) before comparing, so the presence checks match the logical name in every phase. Verified createContentIndexAndDelete under phase 2 and phase 3 (1/0/0 each); phases 0 and 1 already green. Now passes in all four phases. Refs #36501, #36320. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dario-daza
approved these changes
Jul 13, 2026
|
Tick the box to add this pull request to the merge queue (same as
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 13, 2026
ihoffmann-dot
approved these changes
Jul 14, 2026
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
Fixes one of the phase-induced test failures tracked in #36501 (found while running the MainSuite battery under an ES→OS migration phase — see #36320).
ContentletIndexAPIImplTest.createContentIndexAndDeleteasserted an exact single-store delta after creating a working + live index:Under a dual-write migration phase (
-Dopensearch.phase=1/2),createContentIndexfans out to both the ES and OS stores, solistDotCMSIndices()reports two physical entries per logical index and the delta is +4 — failing withexpected:<158> but was:<160>.Fix
Assert the two created indices are present (already checked via
foundWorking/foundLive) and that the total grew by at least two, instead of a single-store exact delta:Phase-agnostic: passes in phase 0 (ES only) and under dual-write.
Verification
Ran under phase 1 locally (
-Dopensearch.phase=1 -Dit.test=ContentletIndexAPIImplTest):Tests run: 16, Failures: 0, Errors: 0✅ (was 1 failure before).Refs #36501 (tracking), #36320 (ContentletIndexAPIImplTest phase-aware decoupling — this assertion is item #4 there).