You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky test: TestStorageEnginesInSlowQuery in pkg/executor #66727
Before fix: this UT fails (blocked on connectedCh).
After fix: this UT passes.
Related test TestStorageEnginesInSlowQuery also passes locally after the fix.
Proposed fix:
In exchSenderExec.next() defer cleanup, wait for either:
tunnel.connectedCh, or
mppCtx.Ctx.Done()
This prevents infinite blocking in tunnel cleanup and allows reqCtx.finish() to run.
Ownership suggestion:
This should be reviewed by unistore/MPP owners (pkg/store/mockstore/unistore/cophandler / MPP task+tunnel lifecycle), not only by slow query test owner.
Verification commands run locally:
make failpoint-enable
go test -run TestExchSenderExecNextReturnsWhenCtxCanceledBeforeTunnelConnected -tags=intest,deadlock ./pkg/store/mockstore/unistore/cophandler -count=1 -timeout=60s (fail before fix, pass after fix)
go test -run TestStorageEnginesInSlowQuery -tags=intest,deadlock ./pkg/executor -count=1 -timeout=300s
Activity
ti-chi-bot commentedon Mar 6, 2026
Automated flaky test report update.
Window: 2026-02-27T00:00:00.000Z → 2026-03-06T00:00:00.000Z
Threshold: 100000 ms
zanmato1984 commentedon Mar 6, 2026
This test is among the top 10 flaky tests in the past week, directly blocking other PRs and affecting CI reliability.
Given its significant impact, it is assigned severity/critical and requires urgent attention.
zanmato1984 commentedon Mar 8, 2026
Root cause analysis (locally verified)
This flaky is a timeout-in-teardown issue, not a result mismatch in
TestStorageEnginesInSlowQuery.The blocking path is in unistore MPP cleanup:
exchSenderExec.next()waits on<-tunnel.connectedChin itsdeferpath.reqCtx.finish()inexecuteMPPDispatch.Server.Stop()keeps waiting forrefCount == 0, so teardown hangs until global timeout.Why this is flaky:
Local proof:
TestExchSenderExecNextReturnsWhenCtxCanceledBeforeTunnelConnected.connectedCh).TestStorageEnginesInSlowQueryalso passes locally after the fix.Proposed fix:
exchSenderExec.next()defer cleanup, wait for either:tunnel.connectedCh, ormppCtx.Ctx.Done()reqCtx.finish()to run.Ownership suggestion:
pkg/store/mockstore/unistore/cophandler/ MPP task+tunnel lifecycle), not only by slow query test owner.Verification commands run locally:
make failpoint-enablego test -run TestExchSenderExecNextReturnsWhenCtxCanceledBeforeTunnelConnected -tags=intest,deadlock ./pkg/store/mockstore/unistore/cophandler -count=1 -timeout=60s(fail before fix, pass after fix)go test -run TestStorageEnginesInSlowQuery -tags=intest,deadlock ./pkg/executor -count=1 -timeout=300smake failpoint-disablemake lintPatch used for verification:
I'm assigning @windtalker to verify. Thanks.
windtalker commentedon Mar 8, 2026
Tha patch looks good to me, I'll create a PR based on this patch
*: fix flaky test TestStorageEnginesInSlowQuery (pingcap#66773)
*: fix flaky test TestStorageEnginesInSlowQuery (#66773) (#66891)
ti-chi-bot commentedon Apr 28, 2026
Automated reopen: flaky detected after this issue was closed.
Repo: pingcap/tidb
Branch: master
Package: pkg/executor
Case: TestStorageEnginesInSlowQuery
Issue closed_at: 2026-03-09T08:06:08.000Z
Build started_at: 2026-04-27T08:43:32.783Z
Build started_at source: jenkins.timestamp
Build: https://prow.tidb.net/jenkins/job/pingcap/job/tidb/job/pull_unit_test_next_gen/2452/
Window: 2026-04-27T00:00:00.000Z → 2026-04-28T00:00:00.000Z
Threshold: 100000 ms
ti-chi-bot commentedon Apr 28, 2026
Automated flaky test report update.
Window: 2026-04-27T00:00:00.000Z → 2026-04-28T00:00:00.000Z
Threshold: 100000 ms
windtalker commentedon Apr 28, 2026
The latest flaky is some query is not in the slow query
@henrybw can you take a look at this?
(#68168)
executor: deflake TestStorageEnginesInSlowQuery (#68168)
executor: deflake TestStorageEnginesInSlowQuery (pingcap#68168)
executor: deflake TestStorageEnginesInSlowQuery (pingcap#68168)
yinsustart commentedon Sep 17, 2026
Close it because it has not been reproduced for more than 1 month.