Skip to content

Slow integration tests: remove real-time waits and per-iteration content-type creation #36912

Description

@wezell

Problem

Per-class timing analysis of the IT suites (run 31054926456) shows a handful of test methods burn CI time on real-clock waits or accidental fixture explosions:

Test Time Cause
StartEndScheduledExperimentsJobTest.testJob 124s Thread.sleep(2 * 60 * 1000) waiting for wall-clock experiment start/end dates
JobQueueManagerAPIIntegrationTest.test_AbandonedJobDetection + test_Abandoned_Permanetly_Job ~100s Jobs are inserted already 5 min stale, but tests wait up to 1 min for the AbandonedJobDetector's scheduled tick (minute-granularity timer)
TagAPITest.findTopTags_should_be_not_null_not_empty_and_contains_one_popular_tags 78s TestDataUtils.getWikiLikeContentType() called inside a 100-iteration loop — creates ~100 content types, ~100 ES update_mapping calls, and permanently bloats the shared index mapping for every test after it (ES mappings are append-only)

Fix

  • Compress the experiment scheduling windows to seconds (validateScheduling only requires dates after now-1min) — sleep 25s instead of 120s
  • Make AbandonedJobDetector.detectAbandonedJobs() public and trigger it directly from the tests instead of waiting for the timer tick
  • Hoist the content-type creation out of TagAPITest's loop (one content type instead of ~100)

Investigated, deferred

ShortyIdApiTest.test404CacheWhenDBDown (76s) — pool is 60 connections with a 3s checkout timeout, so the cost is not a simple timeout knob; needs profiling to find where the time actually goes.

Expected saving: ~4.5 min of aggregate IT time, plus reduced mapping-growth tax on everything downstream of TagAPITest in MainSuite2b.

Related: #36910 (suite reordering).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions