Repository navigation
test(function): centralize fixture ownership and reduce contract test work - #29591
Conversation
Refs matrixorigin#29249. Release terminal cases and preserve borrowed result lifetimes, retire duplicate fixture execution types, and tighten existing temporal and serialization oracles. Whole-package normal/race and incremental static checks pass. Performance reduction is not claimed for this ownership checkpoint; broader audit and independent delivery review remain open.
Refs matrixorigin#29249. Retain float64 epsilon semantics, reject comparator mutants, and preserve exact resource boundaries while reducing Sleep, payload, XML and LIKE test cost.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed commit 9f0fb65aaf541918cb01b1c12b6f3b64e0b57b67 against main@7ff3eac2e8f17c0d013178c287dc686b4360b0f0. No subagents used. Unpublished follow-up commits are excluded.
结论:本次发布 diff 的设计和实现未发现新的阻塞问题;整体交付仍 HOLD,保留 PR 已声明的 #29592 gate。
- 职责归属合理:复用
executeLogicOfOverload,由既有 fixture 统一承担构造回滚和输入/结果释放;RunAndFree复用Run,借用结果的调用者保留到最后一次检查。没有新建重复状态机、缓存或执行路径。 - 完整差异审查覆盖所有 94 个文件。机械替换逐 hunk 核对;另用 AST 对 1,450 处 terminal 调用做同对象后续引用检查,53 处后续引用均先重新构造。未发现释放后继续读取旧结果。下层 vector/result 释放、失败回滚和 helper 所有权转移已跟踪。
- 23 个定长比较分支保留类型映射、NULL 两种不匹配、双 NULL 后续行检查和诊断;float32 精确比较及 float64 epsilon/NaN 语义保持。时间精度和 SERIAL 测试断言加强。Sleep、payload、XML、LIKE 缩减仍覆盖真实执行与容量/工作量边界。
- 分开核算:运行时代码 +3/-3(等价类型替换);fixture 移动归位后净减 210 行,其他测试净减 102 行,测试合计净减 312 行;文档 +107,整体净减 205。文件移动不计减量,也没有证据支持 RSS 改善或整个 CI 的性能提升。
验证:复用此 head 的 CI build/SCA/UT/BVT 结果,并核对 function owning package 在 matrixone_test -race heavy 阶段,终态为 0。本机按当前源码重建 native 库;11 个顶层测试、含子测试共 54 个场景通过(2.953s)。独立挑战补充了“已分配输入后结果 wrapper 构造失败”和“执行中的 Sleep 取消”,验证返回行为及 native/heap 分配归零。TestSleep 在 race 下精确重复 100 次通过(3.498s)。诊断测试已移出工作树,生产代码未修改。
现有评论核销:评审时 PR 没有 review/inline/conversation comments,故没有遗漏的历史评论项。
尚未关闭的交付事项: #29592 记录了 regexp2 的 stale-deadline 缺陷及 owning-package race 失败。本 PR 未修改依赖、regexp_icu.go 或对应失败用例;本轮未将它归因为新增回归,也未把一次绿色 CI 解释成缺陷已解决。继续保持 draft/交付阻塞,直到该已声明 gate 正式闭合。未推送的 benchmark 修复、其余弱错误断言及 #29249 全仓目标不计为本次已完成。
当前账号为 PR 作者,因此以 COMMENT 提交这份 commit review;这不是 GitHub APPROVE。
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Purpose
Refs #29249. Continuation after merged #29585, rebased onto main
7ff3eac2e8.Go code: net 312 lines removed, counting the fixture move as movement rather than reduction. Design/coverage documentation: 107 added lines, net whole change 205 lines removed.
Evidence
gpt-6.1-sol,xhigh, read-only, multi-agent disabled: design and implementation APPROVE. Rebase range-diff shows both reviewed patches identical.9f0fb65aaf: normal 7.024s, race 12.782s, lint/vet exit 0; all 221 Go source hashes unchanged.Matched three-pair serial package measurements before comparator deduplication: wall 9.079s -> 6.281s, CPU 2.397s -> 2.132s, peak RSS 168544 -> 170472 KiB. Compilation excluded. These local observations establish no CI-wide time saving or memory reduction.
Remaining limits
This is a draft continuation, not closure of #29249 or the 342-file audit. Formal regexp2 v1.10 has a deterministic stopped-clock/stale-deadline failure, consistent with a previously observed race failure; a private fix/probe exists but is unpublished and not silently substituted here. A subsequent green run does not erase that defect. Broader error-oracle cleanup, benchmark iteration accounting and the memory objective remain open.
Detailed responsibility and coverage map:
docs/design/20261003-function-test-fixture-ownership.md.Clock gate follow-up
Independent dependency defect is tracked in #29592. The formal regexp2 dependency remains unchanged. Whole-package race failed again at
regexp_icu_test.go:370; the recorded earlier green run does not erase it. Overall delivery remains blocked by that gate.A benchmark-contract follow-up is locally committed as
255303da69but not pushed to this PR head. Full normal tests plus all 176 benchmarks at 1x, the four affected UTs plus all 176 benchmarks under race at 2x, actual B.N+1 entry-count probes, post-admission Cast input mutations, and incremental lint/vet are complete. Independentgpt-6.1-sol/xhighreview accepted the local implementation/evidence closure and explicitly withheld overall delivery approval. The full-package race failure is preserved; it was not retried as an acceptance check.