dotCMS / dotCMS/core

Task240306MigrateLegacyLanguageVariablesTest fails deterministically on main, blocking Integration Tests MainSuite 1a

Open
#37,076 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotCMS : Upgrade OKR : Customer Support Team : Maintenance Type : Defect
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

Task240306MigrateLegacyLanguageVariablesTest fails deterministically on current main, taking down CI Integration Tests → MainSuite 1a for every PR based on that main. Three of its five tests fail:

Test Line Assertion
testExecuteUpgrade :114 The expected languages must be present expected:<4> but was:<3>
testDropThenRecreateLanguageVariableContentType :141 There must be at least 5 successfully processed Locales
testDataTaskIdempotency :171 There must be at least 4 successfully processed Locales in the first run

This is not flakiness. The suite retries automatically, and the failure is identical on Run 1, 2, 3 and 4 — the retry mechanism that would rescue a genuinely flaky test does not help here. Every assertion is a count of locales/languages coming out lower than expected, which suggests the migration is silently processing fewer language variables than it should rather than erroring outright.

Impact: MainSuite 1a is red on affected PRs, and because the job fails fast it also cancels sibling suites (observed cancelling MainSuite 1a's siblings on PR #37053). Reviewers cannot distinguish a genuine regression in their own PR from this pre-existing failure, and the underlying migration correctness question is unanswered — Task240306 is a real upgrade task, so if the migration genuinely under-processes locales, customer upgrades are affected too, not just CI.

Not caused by PR #37053. Verified by experiment rather than inspection: on that branch I reverted all 19 of the PR's files to main and re-ran the test. The result was identical — same three tests, same three assertions at the same line numbers, and a diff of the two assertion sets is empty. So the cause is in the base, not in that PR.

Suspect (unconfirmed): ES reindex work recently merged to mainReindexThread, ContentletIndexAPIImpl, ReindexMappingRunner, ReindexMappingTimeoutException, ReindexPoolExhaustedException, ReindexMappingHealthCheck. This migration indexes contentlets (language variables are contentlets), and the failures are all under-counts, which is consistent with indexing not completing before the assertions run. This is a hypothesis from timing and adjacency only — it has not been bisected or confirmed, and should be verified before any fix is attempted.

Steps to Reproduce
  1. Check out current main (reproduced on the base of PR #37053, head 77d80b63d4).
  2. Build and install core:
    ./mvnw install -pl :dotcms-core --am -DskipTests -Dmaven.build.cache.enabled=false -Ddocker.skip
    
  3. Run the test on its own:
    ./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false \
      -Dmaven.build.cache.enabled=false \
      -Dit.test='Task240306MigrateLegacyLanguageVariablesTest'
    
  4. Observe: Tests run: 5, Failures: 3, Errors: 0, Skipped: 1, failing identically across all four retry runs.

-Dmaven.build.cache.enabled=false is required. Without it the build cache restores the module and skips failsafe:integration-test entirely — the run still prints BUILD SUCCESS with no tests having executed.

Observed in CI: PR #37053, head 77d80b63d4PR Test / Integration Tests - MainSuite 1a; aggregated Test Report 15336 passed, 4 failed, 81 skipped (the 4th failure was unrelated and has since been fixed in that PR).

Acceptance Criteria

Quick draft — to be refined by whoever picks this up.

  • Root cause identified and confirmed by bisect (the ES reindex hypothesis above is unverified).
  • Determined whether this is a test-only problem (e.g. the assertions race an async reindex) or a real migration defect where Task240306 under-processes locales on a customer upgrade — and stated explicitly which it is.
  • Task240306MigrateLegacyLanguageVariablesTest passes on main on the first run, without relying on retries.
  • MainSuite 1a is green on main.
dotCMS Version

Latest from main (reproduced 2026-08-14 against the base of PR #37053, head 77d80b63d4).

Severity

Medium - Some functionality impacted

(CI-blocking for every PR on this main, but with a known workaround: reviewers can attribute MainSuite 1a to this issue. Escalate to High if the root cause turns out to be a genuine migration defect rather than a test-side race.)

Links

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running Task240306MigrateLegacyLanguageVariablesTest with the provided Maven commands and disabled build cache. Inspect Task240306MigrateLegacyLanguageVariablesTest and the migration code, then verify or reject the suspected ReindexThread, ContentletIndexAPIImpl, ReindexMappingRunner, and related ES classes through a bisect or focused timing investigation. Done means the root cause is classified as a test race or migration defect, the test passes without retries, and MainSuite 1a is green.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, java
Domain
backend, ci-cd, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.