perf(test): run full-reindex IT tests first in each suite - #36911
Conversation
Integration tests accumulate content and never clean up, so a full reindex or full-dataset scan costs O(all content created by preceding tests). MainBaseSuite runs @SuiteClasses in declaration order, so a reindex test at position 285/297 reindexes everything the prior 284 classes left behind. Move the full-reindex / full-scan classes to the front of MainSuite1a, 1b, 2a and 2b. Same classes, same suites, different order - no behavioral change. Each block carries a comment so new full-scan tests land at the front too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @wezell's task in 2m 17s —— View job Code Review: reorder IT suites to run reindex/full-scan tests firstVerified against
This is a pure declaration-order change, as claimed. New IssuesNo code-correctness issues. One risk worth calling out explicitly, given it already bit this PR:
The per-block comments explaining the ordering constraint are a good touch and will help keep new full-scan tests at the front. · |
…36910) Running HostAPITest and ESContentFactoryImplTest first deterministically breaks HTMLPageAssetRenderedTest (shouldReturnPageHTMLForPersona, shouldReturnParserContainerUUID failed on all 4 retry runs). HostAPITest.makeDefault() switches the system default host and fires async host-delete jobs; running it before ~80 rendering-dependent classes leaves state the old ordering never exposed. Restore main's 1b order; the other suite reorderings (1a/2a/2b) stay — 2b passed in 35m56s with no hang. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
First CI run results (run 31058941959):
1b failure: moving Pushed |
… slow ITs (dotCMS#36912) (dotCMS#36913) ### Proposed Changes Fixes three of the slowest integration-test hotspots identified from per-class CI timing analysis (run 31054926456). ~4.5 min of aggregate IT time recovered, all behavior-preserving: | Test | Before | Fix | |---|---|---| | StartEndScheduledExperimentsJobTest.testJob | 124s — `Thread.sleep(2 * 60 * 1000)` | Scheduling windows compressed to 10/20 seconds (validateScheduling allows any date after now-1min); sleep 25s | | JobQueueManagerAPIIntegrationTest abandoned-job tests | ~100s — jobs inserted 5 min stale but tests wait for the detector's minute-granularity timer tick | `AbandonedJobDetector.detectAbandonedJobs()` made public; tests trigger the scan directly, latch 3min → 30s | | TagAPITest.findTopTags… | 78s — `getWikiLikeContentType()` inside a 100-iteration loop creates ~100 content types → ~100 ES `update_mapping` calls | Content type hoisted out of the loop (one instead of ~100) | The TagAPITest fix also stops that test permanently bloating the shared index mapping (ES mappings are append-only), which taxes every `update_mapping` from tests that run after it in MainSuite2b. Only production change is a method visibility change (`private` → `public`) on `AbandonedJobDetector.detectAbandonedJobs()` — no logic touched; the scheduled executor calls the same method. Investigated and deferred: ShortyIdApiTest.test404CacheWhenDBDown (76s) — not a simple timeout knob (pool is 60 conns / 3s checkout); needs profiling. Related: dotCMS#36910 / dotCMS#36911 (suite reordering). ### Checklist - [x] Tests (existing tests exercise all changed paths; timing-only changes) - [ ] Translations - [x] Security Implications Contemplated (no security impact) 🤖 Generated with [Claude Code](https://claude.com/claude-code) This PR fixes: dotCMS#36912 --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Proposed Changes
Fixes #36910
Integration tests accumulate content and never clean up (cleaning up is time consuming as well).
MainBaseSuiteruns@SuiteClassesin declaration order with no shuffling, so a test that does a full reindex or edits base content types pay for all the content added previous tests. For example,ESMappingUtilHelperTestruns a reindex and has to reindex the entire accumulated content from every test rather than its own content.This moves those classes to the front of each suite. Same classes, same suites, different declaration order — no behavioral change.
Task240306MigrateLegacyLanguageVariablesTestTemplateAPITestContainerAPIImplTestHostAPITestESContentFactoryImplTestMultiTreeAPITestESMappingUtilHelperTestReindexThreadTestContentletIndexAPIImplMappingTimeoutITReindexAPITestCleanUpFieldReferencesJobTestEMAWebInterceptorTestClasses were picked from CI per-class timings crossed with verified scan patterns (
findAll*,findAllVersions*,executeUpgrade,fullReindexStart,refreshAllContent,createContentIndex) — not a loose grep on "reindex". Each moved block carries a comment explaining the ordering constraint so new full-scan tests are added to the front.Two of the 2b moves are cheap in isolation (
ReindexThreadTestat 0.001s,CleanUpFieldReferencesJobTestat 5.3s) — they are kept in the block because they are genuinely reindex-touching and cost nothing at the front, but the real 2b wins areESMappingUtilHelperTestandReindexAPITest.Checklist
./mvnw test-compile -pl :dotcms-integrationpasses with 0 errors@SuiteClassesentries verified identical tomainby fully-qualified name — nothing added, removed, or duplicatedAdditional Info
Not addressed here:
PublishingResourceIntegrationTesthang (one 2b run cancelled at the 2h job timeout, another idle 26m at position 275/297). That is bundle teardown, not reindex — reordering does not fix it.MainSuite2b(297 classes, 3.6x the next largest suite).🤖 Generated with Claude Code
This PR fixes: #36910