Skip to content

test(iscp): stabilize lease rejection setup and teardown - #29070

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/iscp-lease-fixture
Sep 17, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/iscp-lease-fixture

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #28655
Related to #28419

What this PR does / why we need it:

TestCheckLeaseFailed can exhaust its initial 10-second watermark wait before it reaches the lease-rejection scenario. In the reported CI failure, cold sink database/table commits consumed about five seconds, followed by a roughly 3.45-second data commit. The sink preparation introduced by #29051 did not cover this test.

Prepare the empty sink before registering the job using the existing single-transaction fixture helper. Keep real data propagation and all lease-rejection deadlines/assertions, and add a bidirectional source/sink comparison before injecting the failure. Generate only the two rows the test uses.

Defer executor Stop so it joins background work before the earlier lease-stub reset and engine/RPC teardown. Previously, testing cleanup ran Stop after those function defers, allowing background requests against closed dependencies on early failures.

This changes one test only. It removes cold DDL from the propagation budget and combines two setup commits into one; it does not promise elimination of unrelated slow-commit watermark failures. Cold-target coverage remains in the existing engine tests.

Validation (macOS arm64, Go 1.26.4, repository CGo wrapper, matrixone_test, -short):

  • Exact test under race: PASS, then 21/21 same-process repetitions PASS (-count=21).
  • Full ./pkg/vm/engine/test, normal -count=1: PASS, 151.836s, including the changed test and unchanged cold-target TestISCPExecutor3.
  • Incremental golangci-lint for the changed package: 0 issues; default test vet, gofmt and diff checks passed.
  • Same-host single-run race test body: 1.49s before / 1.40s after. This is a smoke comparison, not a statistical CI speedup claim. Logs confirm sink DDL moved before registration and uses one transaction instead of two.

Historical Ubuntu/x86 CI supplied the timeout evidence; it was not reproduced locally. CI for this PR has not been awaited.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review(head c2f7dbf)

结论:未发现本次变更引入的可证实 P0/P1/P2 阻断问题。由于这是作者自有 PR,本次提交 COMMENT,不提交 APPROVE。

已检查完整 diff(1 个文件,+9/-3)及相关 ISCP executor、lease rejection、fixture teardown 路径:

  • 在注册 job 前创建空 sink,避免 consumer 与 fixture DDL 竞争;helper 使用单事务、严格 CREATE TABLE,结果逐次关闭,失败走 rollback。
  • 新增双向 EXCEPT 校验实际传播后的缺行、多行和数据差异;主键避免 EXCEPT 去重掩盖重复行,原有 watermark 与 rejection 超时断言保留。
  • lease check 的 true→false 注入、非阻塞通知、Submit 拒绝和异步 Cancel 顺序正确;不会让 run 等待自身退出。
  • defer cleanup 覆盖正常返回、FailNow 和 panic:先 Stop,再恢复 stub、关闭 engine/query client/TN/RPC。未发现新增 double cleanup、race、死锁或无界队列。

边界说明:本测试覆盖 lease check 成功后被拒绝,不覆盖真实 acquire/续租/所有权竞争;10 秒是阶段断言预算,不是整个 teardown 硬上限。提前建表只移除了本例冷 sink DDL 路径,其他冷目标创建与故障恢复测试仍保留。

指定 head 的 Ubuntu/x86 race UT、Linux/arm64 SCA 和 CI Required 已通过;Darwin、BVT/Compose、升级和 coverage 项为 skipped,未将其计作通过。

CI:https://github.com/matrixorigin/matrixone/actions/runs/35235601899

This branch was previously deployed

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

Labels

kind/bug Something isn't working kind/enhancement kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TestCheckLeaseFailed intermittently leaves ISCP watermark at 0-0

2 participants