Skip to content

TestCaseResourceIT fails the merge queue: Jdbi pins virtual threads, and the suite summary 404s on deleted test cases #35373

Closed

Description

@mohityadav766

Problem

TestCaseResourceIT's bulk and logical-suite tests are the most frequent merge-queue failure. Between
2026-09-25 and 2026-10-13 they failed in 39 lane reports across 34 PRs, on all three database and search
pairings. Two unrelated causes account for 33 of those reports (28 PRs). Neither is caused by the PRs
under test.

1. Jdbi 3.37.1 pins virtual threads, and the IT server's virtual-thread scheduler stops (21 PRs)

Symptom: the logical-suite tests (test_bulkAdd*, test_bulkRemove*,
test_putPreservesLogicalSuiteSearchMembership, test_deprecatedEndpointStillWorks) fail with
Network error: timeout, the SDK's 300 s read timeout. Each time, 7–69 other tests fail in the same
lane, async deletes stop, NamespaceCleanup … still running after PT2M repeats, and MySQL reports
Lock wait timeout exceeded.

All 12 stall dumps the IT watchdog wrote show the same state. They come from five runs: 37753153290,
38164659731, 38164947502, 38300058144 (a push to main) and 38348381347.

  • The runner has processors=4, and all 4 virtual-thread carriers are held by pinned virtual threads
    (VirtualThread.parkOnCarrierThread).
  • Each pinned thread is inside Jdbi's MemoizingSupplier.init, which is a synchronized block before
    Jdbi 3.45.4. From there the stack is HikariDataSource.getConnection → ProxyLeakTask.schedule
    (leak detection, 60 s by default) → ScheduledThreadPoolExecutor$DelayedWorkQueue.offer →
    ReentrantLock.lock.
  • The thread next in line for that lock is an unmounted virtual thread, and no carrier is free to run
    it, so the scheduler stays stuck for the rest of the run.
  • Anything that waits on virtual-thread work then hangs: async deletes, and search documents built on
    reindex-os-doc-build-* before OpenSearchBulkSink.write joins them. Logical-suite add and remove
    reindex synchronously, so they time out first.

Production runs the same path: Jdbi 3.37.1, leak detection on by default, and virtual threads for async
work and search document builds.

2. Reading a logical suite returns 404 when one of its test cases is deleted mid-request (8 PRs)

Symptom: test_bulkAddAllTestCasesToLogicalTestSuite or test_bulkAddAllTestCasesWithExcludeIds
fails with Entity not found: testCase <another IT's test case>, usually as the lane's only failure.

  • mode: all adds every test case in the database to the suite.
  • After that commits, loading the suite with * runs
    TestSuiteRepository.getTestSummary(List<ResultSummary>), which looks up each listed test case by
    name, one at a time.
  • If another request deletes one of them in that window, the lookup throws and the request returns 404,
    even though the suite was already updated.

A user who selects all while ingestion deletes test cases hits the same error.

Fix

  1. Move to Jdbi 3.49.5, the version dropwizard-jdbi3 5.0.0 is built against, and register the
    connection-aware SQL annotations with @UseExtensionHandler. Collate pins its own Jdbi and has to
    move in lockstep.
  2. Read the suite's test cases in one batch, and leave out results whose test case no longer exists.

Activity

  1. added this to Shipping and removed this from Roadmapon Oct 13, 2026
  2. moved this to In Review / QA 👀 in Shippingon Oct 13, 2026
  3. moved this from In Review / QA 👀 to Done ✅ in Shippingon Oct 14, 2026
  4. added a commit that references this issue on Oct 14, 2026
    1473a2b
  5. added a commit that references this issue on Nov 23, 2026
    8d3dabd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions