Repository navigation
test: give truncate FK identity statements individual operation budgets - #30383
Conversation
TestTruncatePreservesMaterializedForeignKeyIdentity executed ~38 SQL statements under one 60s aggregate context. On the saturated Ubuntu race runner from issue matrixorigin#30351 (cluster-wide heartbeat deadlines, heavy CPU throttling), that aggregate budget ran out mid-test and the deadline fired at an arbitrary in-flight statement, so the CI report blamed the initial self-referencing FK INSERT although earlier statements had already consumed the budget. Keep every SQL statement and assertion unchanged. Each statement now owns a separate 30s operation context derived from a 4min umbrella budget, matching the multi-statement sibling cases in this package. A saturated runner no longer fails an innocent later statement, and a genuinely slow statement fails with its own SQL text in the failure message. Local evidence (race, -short, tags matrixone_test): - focused case on the final code: pass (14.8s) - 60s umbrella plus 2s injected per-statement latency reproduces the incident class (fail at ~71s; the victim statement differs from the CI one, proving the arbitrary-victim property) - 4min umbrella with the same latency: pass (~87s) - one statement slowed past 30s fails with "exec failed: insert into truncate_fk_identity.self values(1,1)" Fixes matrixorigin#30351
Review follow-up on PR matrixorigin#30383: with per-statement contexts, a negative assertion could satisfy itself with context.DeadlineExceeded when the rejected statement exceeded its 30s budget. require.Error accepts any error, the umbrella context stayed alive, the pool reconnected, and the case could pass without ever observing the expected FK rejection. Promote the bounded exec/query closures to named helpers that treat a dead operation context as an immediate test failure carrying the statement text, and route the six negative statements through requireSQLRejection, which requires a server-side *mysql.MySQLError (the pattern already used by issue_25753/issue_25408 tests). A timeout, cancellation or transport failure can no longer satisfy any assertion, positive or negative. Local evidence (race, -short, tags matrixone_test): - injecting a 35s delay into the rejected child FK INSERT: the previous commit passed silently in 56.6s; this commit fails immediately with "statement budget exhausted, exec failed: insert into ...child values(1,999) (context deadline exceeded)" - 2s per-statement incident-class latency still passes under the 4min umbrella (88.4s), preserving the issue matrixorigin#30351 fix property - clean focused case: pass (12.2s); gofmt, vet and incremental lint clean
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? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: ab8bbf4b146c88fb45cd8df5eb1b239730842a90
Assessment: approve
Reviewed the complete test-only delta and affected callers. Per-statement deadlines belong in these local helpers, preserve existing SQL and catalog assertions, and strengthen rejection checks against client failures. Cleanup remains intact, with no production-path cost or actionable findings.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
The changed embedded-cluster regression passed under -race -short -tags matrixone_test: once initially, then three repetitions in one process.
-
Race-enabled probes of byte-identical extracted helpers passed: fresh deadlines, cancellation, transport-error rejection, scan-before-cancel, resource release and an actual 30-second statement timeout.
-
Verified native provenance through the repository build owner. Isolation preflight, formatting and scope/oracle checks passed; source remains unchanged.
-
Reconciled command, source and exit receipts with retained logs in /home/xupeng/.local/state/mo-bot/jobs/54e9fbc0beb0a181ad207f39/attempt-1/review-evidence.json. The initial diagnostic-harness failure is preserved and distinguished from candidate results.
-
Frozen evidence reports successful exact-head Ubuntu UT and Linux/arm64 SCA; skipped jobs were not counted as passes.
Limitations:
-
No local full-package rerun; local execution targeted the changed regression and helper contracts.
-
The original CPU-throttling incident and author-reported latency experiments were not independently reproduced. Helper probes used controlled runners and mocked rows alongside the real cluster regression.
Merge Queue Status
This pull request spent 53 minutes 21 seconds in the queue, with no time running CI. ReasonPull request #30383 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30351
What this PR does / why we need it:
TestTruncatePreservesMaterializedForeignKeyIdentityexecuted ~38 SQL statements under one 60s aggregate context. On the saturated Ubuntu race runner from issue #30351 (cluster-wide heartbeat deadlines, heavy CPU throttling, a 240s-class sibling case running concurrently), that aggregate budget ran out mid-test and the deadline fired at an arbitrary in-flight statement. The CI report therefore blamed the initial self-referencing FK INSERT, although the earlier ~32 statements had already consumed the budget — the reported statement had no causal connection to the slowness.This is a test budgeting defect, not a product failure: the same case passes on clean main locally and remotely, and the failure window shows every embedded subsystem timing out together.
Change (test-only, in
pkg/tests/issues/issue_29852_test.go):exec/queryRowhelpers over an interface satisfied by both*sql.DBand*sql.Conn), derived from a 4min umbrella budget — the budget class already used by multi-statement sibling cases in this package (e.g.TestIssue29399).No shared test helper signatures, production code, fixture topology, retries, sleeps or skips are changed.
Local validation (race,
-short, tagsmatrixone_test)exec failed: insert into truncate_fk_identity.self values(1,1)— the attribution the original CI failure should have produced.go vet -tags matrixone_test, and incremental golangci-lint on the changed package: clean.