Repository navigation
test(iscp): wait for watermark transitions against the test context budget - #30385
Conversation
…udget Fixed-second budgets in waitForISCPWatermark(Absent) silently assumed scheduler speed. The chain that makes a watermark visible (logtail pickup, iteration DDL, durable flush, in-memory republish) consists of operations each bounded by the test's own context deadline, so a slow-but-progressing executor must be judged against that shared budget rather than wall clock. On a starved race runner the chain took 12-17s while the tests allowed only 10s, expiring mid-transition. Derive each wait's budget from the enclosing test context deadline via iscpWaitBudget, keeping the original duration as fallback. Assertions, tick, and helper semantics are unchanged; the blocked-getter timeout unit test keeps its literal budget. Fix matrixorigin#30350
TestStaleRead, TestInitSql, and TestCheckLeaseFailed root their ctx with WithCancel/WithValue only; ctxWithTimeout carries the 5-minute deadline. iscpWaitBudget(ctx, ...) therefore always returned the fallback and the budget fix did not apply there. Pass ctxWithTimeout and add TestISCPWaitBudgetHonorsContextDeadline to pin the deadline/fallback branches, which passing smoke runs cannot distinguish. Refs matrixorigin#30350
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: edfc79092640eaa4e699f42e05e9f1e118ec6f85
Assessment: approve
The helper coherently reuses the executor’s existing deadline budget without changing watermark assertions, polling, fixtures, or cleanup. All 31 callers use the correct context. Production paths are unchanged; slower failure detection is an explicit, reasonable tradeoff.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Reviewed the complete delta, all 19 affected test roots, watermark observation, executor cancellation/cleanup, and supplied comments.
-
Static comparison proved existing behavior is unchanged apart from budget arguments. diff --check passed; formatter differences also exist unchanged in the base.
-
A standalone probe of the verbatim helper passed no-deadline, short, expired, inherited, and long-deadline cases. This used Go 1.25.5 and does not represent native package execution.
-
Reused frozen-head Ubuntu UT and Linux SCA success evidence. Local preflight, probe, and static-audit receipts were reconciled with retained logs in /home/xupeng/.local/state/mo-bot/jobs/ebaa88aa023c0be89874b24b/attempt-1/review-analysis.json.
Limitations:
-
Native integration tests and the original runner-starvation scenario were not rerun locally; raw CI and author logs were not supplied.
-
Failure waits can approach five minutes. The retained 10–30-second fallback floor can extend a wait beyond the context deadline; this preserves the documented fallback behavior.
Merge Queue Status
This pull request spent 20 minutes in the queue, with no time running CI. ReasonPull request #30385 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:
issue #30350
What this PR does / why we need it:
TestFlushWatermarkandTestISCPTableIDChangeexpired atchange_handle_test.go's watermark wait assertions on the Ubuntu race UT runner, even though the ISCP watermark transition was still in progress. The job log shows the runner was heavily starved (ordinary commit latency 2.0-2.2s, executor ticks drifting to seconds), and the chain that makes a watermark visible — logtail pickup of the registered job, iteration execution (including sink DDL), durable final flush, and in-memory republish on a later apply pass — took 12-17s while the tests allowed a fixed 10s budget. The budget, not the transition, failed.A fixed-second budget silently assumes scheduler speed. Every operation on that chain is already bounded by the test's own context deadline, and during one slow commit no intermediate progress signal exists, so no reliable shorter stall threshold is available. This change derives each wait's budget from the enclosing test context deadline via a small
iscpWaitBudget(ctx, fallback)helper, keeping the original duration as fallback when the context has no deadline or less time remains. Assertions, polling tick, and helper semantics are unchanged; the dedicated blocked-getter timeout unit test keeps its literal budget. No product code changes; no sleeps, skips, or weakened assertions. Pass-path duration is unchanged (the wait returns as soon as the state is observed); only failure-mode detection moves to the test's existing 5-minute context budget.Validation (macOS/arm64, race + short + matrixone_test tag; the original Linux/x86 starved environment is not reproducible locally, so this validates the wait-contract change rather than the original failure):
TestISCPTableIDChangeandTestFlushWatermark,-count=3: passTestWaitForISCPWatermarkTimeoutDoesNotWaitForBlockedGetter(helper timeout semantics): passwatermarkWaitvar/const, plainctxdeadline variable): passgo vet ./pkg/vm/engine/test,golangci-lint --new-from-rev: clean