Skip to content

[Bug]: TestDataBranchDiffAsFile panics in RunBaseClusterTests cleanup #25929

Closed

Description

@ck89119

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main (observed in PR #25872 CI)

Commit ID

0885830

Other Environment Information

Actual Behavior

pkg/tests/dml.TestDataBranchDiffAsFile panicked immediately with a nil pointer dereference in the embedded cluster
test cleanup path:

panic: runtime error: invalid memory address or nil pointer dereference
github.com/matrixorigin/matrixone/pkg/embed.RunBaseClusterTests.func2()
    pkg/embed/testing.go:85
github.com/matrixorigin/matrixone/pkg/embed.RunBaseClusterTests()
    pkg/embed/testing.go:113
github.com/matrixorigin/matrixone/pkg/tests/dml.TestDataBranchDiffAsFile()
    pkg/tests/dml/dml_test.go:116

Expected Behavior

TestDataBranchDiffAsFile should either complete successfully or report the cluster startup/test error without
panicking during cleanup.

Steps to Reproduce

go test ./pkg/tests/dml -run TestDataBranchDiffAsFile -count=1

The failure may depend on an earlier embedded-cluster initialization failure in the CI environment.

Additional information

Observed in MatrixOne ALL CI run 29798346785. The panic appears to dereference partially initialized cleanup state.
The failure is unrelated to the prepared binary parameter changes in PR #25872; none of that PR's files touch
pkg/embed or pkg/tests/dml.

Activity

  1. added
    kind/bug
    on Jul 21, 2026
  2. added theissue type on Jul 21, 2026
  3. added
    severity/s0
    and removed on Jul 27, 2026
  4. added a commit that references this issue on Jul 28, 2026
    6ddef3d
  5. added and removed
    severity/s0
    on Jul 29, 2026
  6. Ariznawlll commented on Jul 30, 2026

    @Ariznawlll
    Collaborator

    在最新 main 上对原始 panic 路径和修复后的初始化失败清理路径进行了重复验证,未再复现 nil pointer panic。

    测试版本

    测试过程与结果

    1. 定向验证“集群初始化失败后 cleanup”路径:
    go test ./pkg/embed \
      -run '^TestOnceClusterReportsInitializationError$' \
      -count=20
    

    结果:20/20 通过,无 panic。

    1. 同一路径进行 race 检查:
    go test -race ./pkg/embed \
      -run '^TestOnceClusterReportsInitializationError$' \
      -count=3
    

    结果:3/3 通过,无 race、无 panic。

    1. 运行 issue 中原始测试:
    go test ./pkg/tests/dml \
      -run '^TestDataBranchDiffAsFile$' \
      -count=3
    

    结果:3/3 通过。

    1. 原始测试进行 race 检查:
    go test -race ./pkg/tests/dml \
      -run '^TestDataBranchDiffAsFile$' \
      -count=1
    

    结果:通过,无 race、无 cleanup panic。

    Unhappy path 覆盖

    • 构造初始化函数返回 nil + error,验证 teardown 不再解引用未初始化对象。
    • 同一失败路径重复执行 20 次,均返回原始初始化错误,没有二次 nil-pointer panic。
    • 原始 TestDataBranchDiffAsFile 连续执行 3 次,并执行 -race,均无 cleanup panic 和数据竞争。

    测试结论

    测试通过。

  7. added 3 commits that reference this issue on Sep 17, 2026
    faae0a8
    3fa08b0
    14ea6de
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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions