Skip to content

[Bug] CI UT 整体超时 60 分钟:pkg/sql/plan race 测试未完成就被 timeout kill #26701

Closed

Description

@Ariznawlll

环境

Field Value
PR #26430
CI Run https://github.com/matrixorigin/matrixone/actions/runs/30891209862/job/91933473903
Runner amd64-mo-shanghai-8c16g

问题

UT 整体在 Makefile 中设了 timeout 60m,执行到 pkg/sql/plan race 测试 shard 1/8 时触发 60 分钟超时,被 timeout 命令 kill(exit code 124)。

08:29:48  UT 开始 (race check)
08:30:02  Run light race-test packages (parallelism 6)
09:15:23  Run exclusive race-test packages serially
09:25:04  Run heavy race-test packages (parallelism 3)
09:29:42  Run pkg/sql/plan race shard 1/8 (1531 tests, 192 tests/shard)
09:29:44  make: *** [Makefile:388: ut] Error 124  ← 60 分钟超时

分析

  • PR test: add Data Branch issue BVT coverage #26430 没有修改 pkg/sql/plan,不是 PR 引入的
  • pkg/sql/plan 有 1531 个测试,分成 8 个 shard,仅跑到 shard 1/8 就超时了
  • 之前的 light/exclusive/heavy 测试已经用了 ~55 分钟,留给 sql/plan 的时间不够
  • 这是 UT 整体时间膨胀的问题,不是某个测试特别慢

Makefile 超时设置

@cd optools && timeout 60m ./run_ut.sh UT $(SKIP_TEST)

建议

  1. 加大整体超时至 90 分钟或 120 分钟
  2. 或者减少 pkg/sql/plan 的测试数量 / 分更多 shard
  3. 或者优化 heavy race-test 的执行时间

Activity

  1. added
    kind/bug
    on Aug 4, 2026
  2. self-assigned this
    on Aug 4, 2026
  3. daviszhen commented on Aug 4, 2026

    @daviszhen
    Contributor

    • 8c / 16 GiB 限制下,192 项 pkg/sql/plan race shard 通过。

    场景 Wall time Go 测试执行 内存峰值
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━ ━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━
    首次 race 编译 + shard 1/8 约 87s 11.544s 2.6 GiB
    ───────────────────────────────── ─────────── ───────────── ────────────────────
    race 构建缓存命中后,同一 shard 14.761s 11.249s 未触及 16 GiB 限制

    限制方式:taskset -c 0-7 固定 8 核,systemd transient service 设置 MemoryMax=16G、禁用 swap;测试无 OOM。

    结论:

    • pkg/sql/plan 的 192 项 shard 在 8c16g 下本身不是分钟级测试:缓存命中后约 15 秒。
    • 首次进入该包时,race 编译会使首 shard 增至约 87 秒。
    • 以“1 次首次构建 + 7 次约 15 秒 warm shard”粗估,8 个分片顺序完成约 3 分钟;这是估算,具体取决于各片测试分布。
    • CI 在剩余约 2 秒时才启动 shard 1/8,必然是整体 60 分钟预算耗尽,不是该 shard 自身超时。

    ─ Worked for 5m 21s ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

    › 依据你的评估, issue 的问题是 pkg/sql/plan ut造成的吗

    • 不是根因。pkg/sql/plan 只是最后暴露整体预算耗尽的测试包。

    证据:

    • CI 启动该 shard 后约 2 秒就被外层 timeout 60m 杀掉。
    • 本地 8c16g 下,同等 192 项 shard 缓存命中也需约 15 秒;首次 race 编译约 87 秒。
    • 因此当时即使换成多数其他非瞬时测试包,也会超时。

    更准确的归因是:前序 light/exclusive/heavy race 阶段已耗尽 60 分钟预算,pkg/sql/plan 没有获得足够执行时间。它确实为整个 UT 还需要约数分钟的尾部工作量,但不是“某个 plan 测试异常慢导致 60 分钟超时”。

  4. iamlinjunhong commented on Aug 13, 2026

    @iamlinjunhong
    Contributor

    PR #27010 在 exact head 2f9b4f87a7a6e639956f84e36d03f1ebc7c25442 复现本 issue 的 Ubuntu race UT 整体预算耗尽。

    • failed check:Matrixone CI / UT Test on Ubuntu/x86
    • run/attempt:31694814542 attempt 1
    • job:94430092132
    • failed step:Unit Testing
    • 失败命令链:workflow 执行 MatrixOne make ut;Makefile 第 388 行的外层 timeout 最终返回 Error 124

    时间线与稳定签名:

    11:36:51 Run UT with race check
    12:12:50 Run exclusive race-test packages serially
    12:28:03 Run heavy race-test packages with parallelism 3
    12:35:46 Run 1882 tests in pkg/sql/plan across 8 fresh race-detector processes
    12:36:07 Run pkg/sql/plan race shard 2/8
    12:36:16 Terminated
    12:36:16 UT runner received SIGTERM; reporting work without terminal Go test events
    12:36:44 [active_ut_cases] no active or incomplete UT package/test case found
    12:36:44 make: *** [Makefile:388: ut] Error 124
    

    这是直接的 runner/固定预算证据,不是测试断言或本 PR parser 改动失败:runner 在外层预算到期时终止仍正常推进的 race suite,诊断明确未发现 active/incomplete package/test case;同一 exact head 的独立 Matrixone UT Coverage / UT Coverage on Ubuntu/x86 job 94430172543 已成功,本 PR 的 parser/tree focused 与全量 owning-package 测试也均 exit 0。

    复现方式与本 issue 相同:在 Ubuntu x86 CI 执行完整 make ut race 流程,让 light/exclusive/heavy 阶段消耗大部分固定预算,观察 pkg/sql/plan 顺序 shards 尚未跑完即收到 SIGTERM 并以 124 退出。

    按已批准维护流程,run 31694814542 的 failed jobs 已只 rerun 一次。GitHub API 已确认 run 进入 attempt 2、状态 queued,新 Ubuntu UT job 为 94456822054。

  5. iamlinjunhong commented on Aug 17, 2026

    @iamlinjunhong
    Contributor

    PR #27225 的 exact head 41f83e415348bf51d84ec0c96108dcabec39b4e3 再次复现本 issue 的 Ubuntu race UT 总预算耗尽。

    • failed check:Matrixone CI / UT Test on Ubuntu/x86
    • run/attempt:32002725376 attempt 1
    • job:95306075943
    • failed step:Unit Testing
    • 失败命令链:workflow 的 make ut,Makefile 第 388 行外层 timeout 返回 Error 124。

    稳定签名及证据:07:48:02 Terminated → UT runner received SIGTERM; reporting work without terminal Go test events → [active_ut_cases] no active or incomplete UT package/test case found → make: *** [Makefile:388: ut] Error 124;总耗时 real 62m30.035s。这不是测试断言/编译失败,而是前序 race 阶段耗尽整体时间预算后的 runner SIGTERM。

    本 PR 另一个失败的 Coverage job 是本 PR 新增错误分支仅达 5/7 覆盖所致,已另行补充测试修复并将推送新 head;因此按 PR 修复流程不重跑这个混合失败的旧 run,新 push 会创建独立的新 CI run。

  6. iamlinjunhong commented on Aug 18, 2026

    @iamlinjunhong
    Contributor

    PR #27256(head ee92d567ab79c293174452b1ddf7d34a477b51a9)再次命中本 issue 的 Ubuntu race UT 整体预算耗尽签名。

    稳定失败签名(无 assertion/panic/compile error):

    07:05:25 Run 163 tests in github.com/matrixorigin/matrixone/pkg/vm/engine/test across 2 concurrent fresh race-detector processes
    07:07:08 go tool test2json: signal: terminated
    07:07:10 UT runner received SIGTERM; reporting work without terminal Go test events
    active: pkg/fileservice/TestCOSParallelMultipartAbortOnError
    active: pkg/vm/engine/test/TestCCPRCreateDelete
    active: pkg/vm/engine/test/Test_Append
    make: *** [Makefile:388: ut] Error 124
    real 66m45.352s
    

    本次按 flake 判定要求收集的四项证据:

    1. 在 PR head 使用 CI 等价的 -race -tags matrixone_test -short -vet=off 和 CGo 链接方式,精确运行上述三个活跃用例连续 3 次,全部 exit 0。
    2. PR 真实 diff 仅改动 pkg/iceberg/metadata/{cache_loader,scan_planner} 及其测试,不触及 pkg/fileservice 或 pkg/vm/engine/test 的失败用例/调用链。
    3. 在干净当前 up/main worktree(35e0bd5eb5ffb8d6f73638dfc9f4b95e5e9ad53f)重建原生依赖后,用相同命令及独立 GOCACHE 复跑:fileservice 2.090s、engine/test 12.376s,最终 exit 0。
    4. 该 run 的独立 Matrixone UT Coverage / UT Coverage on Ubuntu/x86 job 95612426545 已成功;同时 failed job 日志直接记录 runner SIGTERM。

    因此该失败不归因于 PR 的 Iceberg 改动,而是 race UT 全局时间预算耗尽。按已批准流程,接下来仅对 run 32104910186 的 failed jobs 请求一次 rerun。

  7. iamlinjunhong commented on Aug 18, 2026

    @iamlinjunhong
    Contributor

    PR #27276 的 exact head cf75c88f2b4f1ae5f0ff646d7d8db4b1c44abebc 再次复现本 issue 的 Ubuntu race UT 整体 60 分钟预算耗尽签名。

    稳定签名(没有 assertion、panic、编译错误或 race report):

    11:06:55 Run 163 tests in github.com/matrixorigin/matrixone/pkg/vm/engine/test across 2 concurrent fresh race-detector processes
    11:06:55 Start race shard 1/2 and 2/2
    11:07:53 go tool test2json: signal: terminated
    11:07:53 UT runner received SIGTERM; reporting work without terminal Go test events
    active: pkg/vm/engine/test/TestISCPExecutor8
    active: pkg/vm/engine/test/TestUpdateJobSpec
    make: *** [Makefile:388: ut] Error 124
    real 68m0.365s
    

    四项归因证据:

    1. 在 PR head 使用仓库 mo-cgo-test 与 CI 相同的 -vet=off -short -race -tags matrixone_test -p 1 -count=1 -timeout=40m,精确运行两个 active test 各连续 3 次,全部 exit 0:TestISCPExecutor8 4.531s / 4.503s / 4.409s;TestUpdateJobSpec 5.798s / 5.623s / 5.689s。
    2. PR diff 仅修改 pkg/frontend/authenticate.go、pkg/frontend/mongodb_test.go 和 test/mongodb/*;没有修改 pkg/vm/engine/test。该测试文件虽包级 import frontend,但上述两个测试函数的执行闭环不调用本 PR 修改的 determinePrivilegeSetOfStatement,生产改动也没有 init/全局副作用。
    3. 在 fetch 后的 clean official up/main detached worktree d4d242daf7b3a75688cfe6fea3739ee8b02f5aae 自行重建 third-party/CGo 产物,用同一命令复跑:TestISCPExecutor8 5.573s、TestUpdateJobSpec 5.703s,均 exit 0。
    4. 日志直接证明 Makefile 固定预算在两个 test 启动约 1–2 秒后发送 SIGTERM 并返回 124;同一 exact head 的独立 UT Coverage on Ubuntu/x86 也已成功。

    补充自审验证:变更 owning packages 的 deterministic CGo build/vet 通过;新增 frontend race 回归 3.787s、MongoDB mock race 回归 1.739s;git diff --check 通过,工作树干净。

    因此该失败不归因于 PR 的 MongoDB privilege 修复,而是 race UT 全局时间预算耗尽。按已批准维护流程,本评论经 API 回读确认后,将只对 run 32124253611 的 failed jobs 请求一次 rerun。

  8. iamlinjunhong commented on Aug 20, 2026

    @iamlinjunhong
    Contributor

    PR #27271 在 exact head e1c31f5894151a1fe70b13960c2348965b06953f 再次复现本 issue 的 Ubuntu race UT 整体 60 分钟预算耗尽签名。

    稳定签名(无 assertion、panic、compile error 或 race report):

    09:54:01 Run 163 tests in pkg/vm/engine/test across 2 fresh race processes
    09:59:27 Terminated
    09:59:27 UT runner received SIGTERM; reporting work without terminal Go test events
    09:59:40 active UT case: pkg/vm/engine/tae/db/test TestAppendBat
    09:59:40 make: *** [Makefile:388: ut] Error 124
    

    TestAppendBat 的 active event 仅比外层 SIGTERM 早约 0.5 秒,因此它是预算到期时恰好处于 run 状态的用例,不是日志证明的 60 分钟挂起用例。

    本次按非 PR flaky candidate 规则收集的四项证据:

    1. 在 PR head 使用 CI 等价的 -mod=readonly -vet=off -short -race -tags matrixone_test -p 1 -count=1 -timeout 40m 与仓库 CGo 头/库链接方式,精确运行 ^TestAppendBat$ 连续 3 次,全部 exit 0:测试体 2.66s / 2.21s / 2.26s,package 5.448s / 4.704s / 4.863s。
    2. PR 的生产 diff 仅在 pkg/sql/mongodb/mapping.go 为 MongoDB external-table DDL mapping 增加 SET gate,另有 MongoDB/plan 测试。完整 test package 图会传递链接 pkg/sql/mongodb,但精确 TestAppendBat 的运行闭环只创建 mock schema/batch,并发执行 bat.Window、containers.BuildBatch 和 Extend;它不建 SQL plan、不会调用唯一生产 caller pkg/sql/plan/build_ddl.go -> sqlmongodb.ParseTableMappingSpec,修改文件也无 init/全局副作用,因此未触及该 active test 的实际调用链。
    3. fetch 后在 clean official up/main detached worktree 2a38e2a4b50b92fefbef7f74ec9c9fe3f0d5cf3b 用同一 race/tags/CGO 命令复跑,测试体 2.08s、package 4.384s,exit 0。
    4. 同一 exact head 的独立 Matrixone UT Coverage / UT Coverage on Ubuntu/x86 成功;它执行全 test_scope 的 go test -mod=readonly -json -short -v -tags matrixone_test -p 6 -coverpkg=...,上传的 profile 含 pkg/vm/engine/tae/db/test blocks。failed UT 日志同时直接记录 runner SIGTERM/124。

    同一 run 的 Coverage merge job 95664265400 仅因 prerequisites_ready=false 报 coverage merge skipped because at least one required producer was skipped or failed,属于 producer 失败的派生结果;PROXY BVT 的独立根因证据补充到 #27265。

    因此该 UT 失败不归因于本 PR 的 MongoDB SET gate,而是本 issue 已跟踪的 race UT 全局预算耗尽。按已批准维护流程,本评论经 API 回读确认后,将只对 run 32118150473 的 failed jobs 请求一次 rerun。

  9. gouhongshen commented on Sep 9, 2026

    @gouhongshen
    Contributor

    Recurrence evidence from PR #28511 at exact head 846bed3cf937ddbcc184ce5fd4b04601048aae.

    The failed job has no compile error, test assertion, panic, or race report. Its runner checkpoint shows the changed exclusive package github.com/matrixorigin/matrixone/pkg/tests/issues completed with status 0; the embedded-cluster stage completed with status 0; and both pkg/vm/engine/test race shards completed with status 0. The fixed global budget then started pkg/sql/plan with 8 shards at 16:35:00Z, received SIGTERM at 16:36:17Z, and reported:

    [run_tests] [ERR] UT runner received SIGTERM at stage=heavy label=resource-heavy race-test packages
    [active_ut_cases] no active or incomplete UT package/test case found
    make: *** [Makefile:513: ut] Error 124
    real 72m8.438s
    

    This is the existing issue's global Ubuntu race-UT budget exhaustion signature, not a regression in #27618 or PR #28511. The PR changes only pkg/tests/issues/issue_26875_test.go; the exact-head coverage producer also completed successfully. The failed-jobs rerun was already consumed at attempt 2, so no further rerun is requested.

    Recurrence evidence from PR #28511 current head 809e5d9b0ddc01d482de57f877166444f45ec402 before the required main rebase:

    The changed exclusive pkg/tests/issues stage completed with status 0. The embedded-cluster stage recorded status 1 without an exposed assertion, panic, race report, or failed-case result; the later pkg/vm/engine/test shards completed with status 0. The fixed 70-minute outer budget then sent SIGTERM while pkg/vm/engine/tae/db/test/TestSnapshotMeta was active and returned:

    [run_tests] [ERR] UT runner received SIGTERM at stage=heavy label=resource-heavy race-test packages
    [active_ut_cases] active UT case: package=github.com/matrixorigin/matrixone/pkg/vm/engine/tae/db/test test=TestSnapshotMeta state=run started=2026-09-10T00:06:53.963117431Z
    make: *** [Makefile:513: ut] Error 124
    real 71m24.683s
    

    This confirms the known global Ubuntu race-UT budget exhaustion tracked by #26701, not a failure in the PR change; the exact-head pkg/tests/issues stage passed. The attempt-2 workflow is terminal and no further rerun is permitted.

  10. iamlinjunhong commented on Nov 23, 2026

    @iamlinjunhong
    Contributor

    Race UT global-budget recurrence on PR #33094, exact head e5ab449709cf4f9119ef4db75cccbc22a78dd86a. Run 45163821269, attempt 1

    • Ubuntu/x86 UT job 137656116673 ran make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all with Go 1.26.4 on amd64-mo-shanghai-8c16g. The unchanged Makefile's outer timeout 90m ./run_ut.sh UT exited 124. The light, exclusive and heavy phases ran before planner shards began. Planner shards 1 and 2 passed in 12.019s and 8.125s after roughly 21s of launch overhead each. Shard 3 started at 12:53:30 UTC, continued passing cases at 12:53:56.943 UTC, and was terminated at 12:53:56.959 UTC. TestLeadingCompositeRangeWithReversedOperands was active for about 16ms, and shards 4–8 had yet to launch. UT job
    • The complete job log and recovered JSON report showed two earlier test failures. TestIcebergSQLEngineEmbeddedSecurityErrors hit its 30s account-creation deadline at iceberg_sql_harness_test.go:800. TestCatalogReplayStreamsPersistedSystemTables hit its two-minute test context while dropping tables at catalog_stream_replay_test.go:89. The report contains no compiler failure, race-detector report or test-binary timeout panic. All three named cases passed in the exact head's Linux UT Coverage run. Race diagnostics · UT Coverage job
    • The PR's bounded point-index sampler runs for eligible SELECT scans with competing equality access paths. The failing Iceberg operation is account creation before Iceberg planning, the catalog case talks directly to TAE, and the active planner test calls the existing composite cluster-key range helper directly. The PR diff is disjoint from those execution paths and the CI harness. The PR's own TestPointIndexSelectionAfterAnalyze passed in this race job (63.47s). Its package finished at 12:16:41 UTC, over four minutes before the light phase ended.
    • Focused race controls used Go 1.26.4 on Darwin/arm64, CGO with matching native inputs, and three fresh processes per case at the exact PR head and clean official 4.2-dev commit a9cd1796eced8ec4a32bc9cd1e577f18b73ea7e3. All runs passed.
    Case PR head (s) Official 4.2-dev (s)
    Iceberg account setup and test 20.42 / 23.66 / 21.03 42.23 / 22.11 / 19.34
    TAE catalog replay test 15.22 / 16.50 / 14.22 15.66 / 13.33 / 16.17
    Active composite-range test 0.00 / 0.00 / 0.00 0.00 / 0.00 / 0.00
    go test -mod=readonly -race -short -v -tags matrixone_test -p 1 -count=1 -timeout=40m \
      -run '^(TestIcebergSQLEngineEmbeddedSecurityErrors|TestCatalogReplayStreamsPersistedSystemTables|TestLeadingCompositeRangeWithReversedOperands)$' \
      ./pkg/embed ./pkg/vm/engine/tae/db/test ./pkg/sql/plan

    CI Required job 137706576342 propagated the matrixone-ci: failure result. The same run's missing free and Coverage prerequisite failure are independently tracked in #33099. The same size-3 missing free and allocation path also reproduced on the current official comparison commit above. The authorized action for this run is one failed-jobs rerun.

  11. iamlinjunhong commented on Nov 30, 2026

    @iamlinjunhong
    Contributor

    Ubuntu/x86 race UT global budget recurrence on PR 33424

    PR #33424, exact head 19b151353a7c73a8738db1c84341641e861b0b15, CI base 70bb7b35155ac33f9a0f6ed4ec5f4a00bbd7b4f3. Run 46342788817 attempt 1, Ubuntu/x86 job 141599691047, Unit Testing step.

    • The runner executed make ut UT_CONFIGURED=1 UT_PARALLEL=8 UT_TIMEOUT=40 UT_SHARD=all under Go 1.26.4 on the Linux/x86 8-core/16-GiB runner class. The Makefile uses an outer timeout 90m ./run_ut.sh UT.
    • UT opened its report at 02:55:40 UTC, the light race phase ran 02:56:08–03:55:22, the serial phase ended at 04:15:25, and the planner shards began at 04:24:01. Shards 1–3 completed with package PASS events at 04:24:22.925, 04:24:50.602, and 04:25:11.668. Shard 4 started at 04:25:12 and emitted its last recorded passing case at 04:25:39.474, less than a second before the Makefile returned Error 124 at 04:25:40.452. Shards 5–8 never launched. The recovered untruncated JSON report has no unfinished individual planner case at cutoff.
    • The PR diff contains six Proxy files. It leaves Makefile, UT orchestration, module and native dependencies, and the planner shard source at their CI-base versions. The same run's pkg/proxy package finished with a PASS at 03:20:38 (41.892 seconds). The outer budget expiration and continuing planner progress match the symptom tracked here.
    • The recovered report also contains earlier tenant setup and DROP deadlines plus a RESTORE test-hook race in separate packages. Those require their own attribution. The outer timeout does not erase those results.

    Reproduction is the normal full Linux race UT lane under its 90-minute suite budget. The workflow was still queued on Coverage merge when this recurrence was recorded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions