Skip to content

Integration tests fail randomly in the merge queue: CsvExportMultiNodeIT starts extra servers inside the parallel lane's JVM #33738

Description

@mohityadav766

Problem

Integration tests fail randomly in the merge queue while the same commit is green on PR CI, and the
failures land in unrelated suites each time. Two seen recently:

EventSubscriptionResourceIT.test_enableDisableSubscription:796->patchEntity:141
  » OpenMetadata Failed to update entity: An exception with message
    [Unable to unschedule trigger [OMAlertJobGroup.aa70ef72-1c9c-4458-a02d-b987342c9dbb]
     while deleting job [OMAlertJobGroup.aa70ef72-1c9c-4458-a02d-b987342c9dbb]]

GlossaryTermResourceIT.test_searchGlossaryTermsWithOffsetPagination:2930->createEntity:140
  » Api An exception with message [Cannot invoke
    "org.openmetadata.service.events.lifecycle.EntityLifecycleEventHandler.getSupportedEntityTypes()"
     because "handler" is null]

Run: https://github.com/open-metadata/OpenMetadata/actions/runs/35614287289/job/106382364944

Root cause

CsvExportMultiNodeIT runs in the parallel lane, where it boots extra full OpenMetadata
servers inside the shared test JVM while 4 JUnit workers drive the primary app.

It is @Tag("multi-node") and listed in integrationTests.multiNodeTests
(openmetadata-integration-tests/pom.xml:25), but unlike its three siblings it was never added to
any isolated-tests <includes> or parallel-tests <excludes> list — it appears at exactly one
line in that pom, while each sibling appears 16 times.

The tag backstop that should have caught it is inert: in parallel-tests,
<excludedGroups>scale</excludedGroups> sits inside <systemPropertyVariables> where failsafe never
reads it (the pom documents this exact mistake at lines 1502-1505 and gets it right in search-it
and ui-it). The other 7 parallel-tests executions have no excludedGroups at all.

Its own Javadoc names the hazard: "SessionMultiNodeCluster starts extra Dropwizard instances
inside this JVM, so the nodes share a database ... but also share a filesystem and JVM statics."

Timeline from the failing run

15:15:20.940  [INFO] Running org.openmetadata.it.tests.CsvExportMultiNodeIT   <- parallel lane
15:15:21.665  OpenMetadataApplicationConfigHolder is already initialized; ignoring new config
15:15:22.171  OpenMetadataApplication: Phase 1: Initializing core search infrastructure
15:15:22.267  EntityLifecycleEventDispatcher: Replaced entity lifecycle handler: SearchIndexHandler
15:15:45.940  OpenMetadataApplication: Phase 1: Initializing core search infrastructure   <- node B
15:15:46.109  EntityLifecycleEventDispatcher: Replaced entity lifecycle handler: SearchIndexHandler
15:15:47.723  [INFO] Running org.openmetadata.it.tests.EventSubscriptionResourceIT
15:15:50.743  ERROR org.quartz.SchedulerException: Unable to unschedule trigger [...]

Those are the only two mid-run SearchRepository constructions in the whole 11-minute run;
everything else is bootstrap at 14:53.

Why each symptom follows

handler is null — each extra node's SearchRepository constructor mutates the process-global
EntityLifecycleEventDispatcher handler list. This mechanism is already fixed by #33712, but the
trigger is not.

Unable to unschedule trigger — Quartz is clustered (isClustered=true, JobStoreTX) against
the same DB, and every booting node runs EventSubscriptionResource.initialize() ->
initializeEventSubscriptions(), which walks every subscription and calls
addSubscriptionPublisher(sub, reinstall=true) -> deleteEventSubscriptionPublisher on the same
trigger keys the test is patching. QuartzScheduler.deleteJob (verified against the 2.5.0-rc2
bytecode) calls getTriggersOfJob(jobKey) and then unscheduleJob(triggerKey) in separate
JobStoreTX transactions
— if the trigger disappears in between, unscheduleJob returns false and
it throws. Stack from the run:

QuartzScheduler.deleteJob(QuartzScheduler.java:954)
EventSubscriptionScheduler.deleteEventSubscriptionPublisher(EventSubscriptionScheduler.java:291)
EventSubscriptionScheduler.updateEventSubscription(EventSubscriptionScheduler.java:283)
EventSubscriptionResource.patchEventSubscription(EventSubscriptionResource.java:415)

This part is not only a test concern: in a real deployment every node reinstalls every subscription
on startup against one clustered job store, so a rolling restart hits the same race.

Proposed fix

  1. Add CsvExportMultiNodeIT to every isolated-tests <includes> / parallel-tests <excludes>.
  2. Move <excludedGroups> to a direct <configuration> child in all 8 parallel-tests executions
    as scale,multi-node, and tag all four multi-node classes @Tag("multi-node") so a future one
    is excluded even if the filename lists are forgotten.
  3. Make alert scheduling idempotent: write the job and trigger in one transaction via
    scheduleJob(jobDetail, Set.of(trigger), true) instead of delete-then-add, and remove the trigger
    before the job on delete.
  4. Make SessionMultiNodeCluster refuse to start when it finds itself in a fork configured for
    parallel execution, so a lane misconfiguration fails immediately and self-describes.

Activity

  1. added a commit that references this issue on Sep 22, 2026
    310f3dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions