Skip to content

[Flaky UT]: TestIssue26111 data-branch cleanup times out during embedded-cluster teardown #28098

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

Environment

Actual behavior

The Ubuntu/x86 UT job failed only in:

github.com/matrixorigin/matrixone/pkg/tests/issues/isolated
TestIssue26111DataBranchDatabaseWithCyclicForeignKeys

The business assertions were not reported as failing. During cleanup, the test received:

Received unexpected error:
context deadline exceeded

exec failed: drop database if exists issue_26111_branch

The surrounding service logs also reported the CN/backend becoming unavailable, including:

dial tcp4 127.0.0.1:10102: connect: connection refused

The test ran for 61.93 seconds before failing. The package was the only failed UT package.

Flakiness evidence

The same exact test passed in later successful Ubuntu/x86 UT jobs:

This strongly indicates a timing and load-sensitive embedded-cluster or teardown lifecycle failure rather than a deterministic regression in #27990. #27990 changes statement-digest parsing and planning and does not modify this test, embedded-cluster startup, CN/TN lifecycle, HAKeeper, or data-branch cleanup.

Expected behavior

  • A healthy embedded cluster should allow test cleanup to finish within its bounded context.
  • A transient CN/TN/backend loss should produce an actionable cluster-lifecycle diagnosis, not an unrelated product-test failure.
  • Test cleanup must remain bounded and must not leave branch or database state that contaminates later tests.
  • The regression test must retain strict assertions for cyclic-FK data-branch correctness. Do not fix this by weakening assertions or adding blind sleeps or retries.

Investigation and acceptance criteria

  1. Identify the first causal event before the drop database timeout: embedded-cluster readiness or liveness loss, HAKeeper/TN/CN failure, lockservice/backend failure, or test cleanup ordering.
  2. Reproduce the failure under CI-equivalent Ubuntu/x86 UT parallelism, or provide a clean-main recurrence proving it is independent of the validating PR.
  3. Verify success, timeout, cancellation, partial cleanup, and repeated-test paths for the test cluster and branch database.
  4. Ensure failed cleanup cannot leak state or poison subsequent tests.
  5. Preserve the original [Bug]: DATA BRANCH CREATE DATABASE rejects valid cyclic foreign-key schemas #26111 business oracle and demonstrate repeated successful runs after the fix.
  6. Record exact commit, runner, package parallelism, test duration, and terminal result for validation.

Current classification: flaky test-infrastructure lifecycle issue; root cause is not yet proven.

Activity

  1. XuPeng-SH commented on Sep 3, 2026

    @XuPeng-SH
    ContributorAuthor

    Root cause is now proven from the failed-job timeline and source ownership:

    • the functional assertions completed around 08:17:32.61;
    • deferred cleanup then reused one 30-second context for DROP ACCOUNT, snapshot cleanup, and four database drops;
    • DROP ACCOUNT expands into many tenant-catalog DDL/DML operations and consumed almost the whole budget on the loaded runner;
    • DROP DATABASE issue_26111_branch was the next operation and was canceled when that shared cleanup deadline expired;
    • query-service connection refused messages appeared during the subsequent cluster shutdown and are downstream noise, not the initiating cause.

    The test already owns a fresh embedded cluster and unique data path, so SQL pre-clean and teardown are redundant and scale-dependent. PR #28099 removes that second cleanup owner while retaining connection close, cluster close, and every data-branch/FK oracle. It does not increase timeouts, add retries, or weaken assertions.

    Validation on exact change:

    • focused normal: PASS (15.85s)
    • focused race: PASS (19.22s, count 1 per adaptive budget)
    • same-process repeat: PASS 3/3 (13.04s, 12.97s, 12.92s)
    • owning package: PASS 7/7 (134.53s)

    Fix: #28099

  2. added a commit that references this issue on Sep 3, 2026
    2691152
  3. added 3 commits that reference this issue on Sep 17, 2026
    3af8665
    d766a0a
    c1b1b8d
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

    kind/bugphase/testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions