Repository navigation
test: stabilize embedded and ISCP race tests under CI load - #26409
Merged
Merged
Conversation
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? |
XuPeng-SH
force-pushed
the
fix/iceberg-embedded-account-timeout-26107
branch
from
July 29, 2026 17:09
a0874b7 to
d10c665
Compare
XuPeng-SH
force-pushed
the
fix/iceberg-embedded-account-timeout-26107
branch
from
July 29, 2026 18:41
dc632e8 to
76b12be
Compare
1 task done
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…gin#26409) ## What type of PR is this? - [x] BUG - [x] Test and CI ## Which issue(s) this PR fixes Fixes matrixorigin#26107 ## What this PR does / why we need it This PR fixes three timing-sensitive race-UT failures by closing their timeout and asynchronous-state contracts. Successful paths do not sleep, and correctness is asserted from observable state transitions. ### Embedded Iceberg tenant setup `CREATE ACCOUNT IF NOT EXISTS` initializes tenant catalog/system tables and is safe to retry. The old helper used one 10s context for both the active SQL request and the whole retry loop. Once an attempt consumed that deadline, the retry path had no remaining budget. - bound each SQL attempt independently; - give the complete create operation a separate 30s budget; - stop immediately when the outer context expires; - retry only connection/transient errors; - validate retry policy and cover attempt expiry, outer expiry, cancellation, connection errors, and definitive SQL errors without short timing assertions. ### Object-count schema coverage `TestCalculateObjectCount` started a complete Log/TN/CN cluster only to verify whether the frontend-generated `SHOW ACCOUNTS` SQL includes `object_count`. Under race load, that exposed unrelated Dragonboat/HAKeeper bootstrap timing. The production decision and the SQL it controls now come from one helper. Focused tests validate and parse the actual generated SQL for: - sys tenant + metrics database + no `LIKE` (include `object_count`); - non-metrics database; - filtered sys queries; - non-system tenants, including preservation of the existing account-only filtering behavior. The full embedded-cluster test is removed; existing frontend tests continue to cover the projection itself. ### ISCP recovery test The old test used `Never(100ms)` to infer that an asynchronous failure happened, then removed the fault and waited up to 10s per watermark. It never proved that the worker had reached the intended fault, so scheduler load could make the injection disappear before it was exercised. In the reported run, recovery also crossed the fixed assertion deadline shortly after the transaction committed. Each injected phase now has an optional context-aware fault barrier: 1. install the barrier and the executor fault; 2. append the target transaction; 3. wait until a worker is observably parked at that exact fault; 4. assert the target watermark has not advanced; 5. remove the main fault before releasing all parked workers; 6. wait for all three watermarks under one 30s phase hang guard. All fault points have exactly-once cleanup, including `FailNow` paths. Normal production execution is unchanged because the barrier exists only when a test installs its keyed fault point. Failure evidence: https://github.com/matrixorigin/matrixone/actions/runs/30469746913/job/90636646900?pr=26161 ## Scope The earlier comment-only `optools/run_ut.sh` change was removed. This PR does not change package scheduling or globally serialize unrelated tests. ## Validation - CGo-configured `go build` for changed non-test packages - CGo-configured `go vet` for all owning packages - `make err-check` - `bash -n optools/run_ut.sh` - `git diff --check` - adaptive exact race tests: - `TestISCPExecutor4`: measured 5.32s, `-race -count=5` - six embedded account retry/deadline tests: each `-race -count=100` - `TestBuildShowAccountsSQL`: `-race -count=100` - complete owning-package race tests (`-race -count=1`), run serially: - `pkg/frontend`: 26.2s - `pkg/embed`: 116.7s - `pkg/util/test`: 1.1s - `pkg/iscp`: 1.2s - `pkg/objectio`: 2.1s - `pkg/vm/engine/test`: 171.9s
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…gin#26409) ## What type of PR is this? - [x] BUG - [x] Test and CI ## Which issue(s) this PR fixes Fixes matrixorigin#26107 ## What this PR does / why we need it This PR fixes three timing-sensitive race-UT failures by closing their timeout and asynchronous-state contracts. Successful paths do not sleep, and correctness is asserted from observable state transitions. ### Embedded Iceberg tenant setup `CREATE ACCOUNT IF NOT EXISTS` initializes tenant catalog/system tables and is safe to retry. The old helper used one 10s context for both the active SQL request and the whole retry loop. Once an attempt consumed that deadline, the retry path had no remaining budget. - bound each SQL attempt independently; - give the complete create operation a separate 30s budget; - stop immediately when the outer context expires; - retry only connection/transient errors; - validate retry policy and cover attempt expiry, outer expiry, cancellation, connection errors, and definitive SQL errors without short timing assertions. ### Object-count schema coverage `TestCalculateObjectCount` started a complete Log/TN/CN cluster only to verify whether the frontend-generated `SHOW ACCOUNTS` SQL includes `object_count`. Under race load, that exposed unrelated Dragonboat/HAKeeper bootstrap timing. The production decision and the SQL it controls now come from one helper. Focused tests validate and parse the actual generated SQL for: - sys tenant + metrics database + no `LIKE` (include `object_count`); - non-metrics database; - filtered sys queries; - non-system tenants, including preservation of the existing account-only filtering behavior. The full embedded-cluster test is removed; existing frontend tests continue to cover the projection itself. ### ISCP recovery test The old test used `Never(100ms)` to infer that an asynchronous failure happened, then removed the fault and waited up to 10s per watermark. It never proved that the worker had reached the intended fault, so scheduler load could make the injection disappear before it was exercised. In the reported run, recovery also crossed the fixed assertion deadline shortly after the transaction committed. Each injected phase now has an optional context-aware fault barrier: 1. install the barrier and the executor fault; 2. append the target transaction; 3. wait until a worker is observably parked at that exact fault; 4. assert the target watermark has not advanced; 5. remove the main fault before releasing all parked workers; 6. wait for all three watermarks under one 30s phase hang guard. All fault points have exactly-once cleanup, including `FailNow` paths. Normal production execution is unchanged because the barrier exists only when a test installs its keyed fault point. Failure evidence: https://github.com/matrixorigin/matrixone/actions/runs/30469746913/job/90636646900?pr=26161 ## Scope The earlier comment-only `optools/run_ut.sh` change was removed. This PR does not change package scheduling or globally serialize unrelated tests. ## Validation - CGo-configured `go build` for changed non-test packages - CGo-configured `go vet` for all owning packages - `make err-check` - `bash -n optools/run_ut.sh` - `git diff --check` - adaptive exact race tests: - `TestISCPExecutor4`: measured 5.32s, `-race -count=5` - six embedded account retry/deadline tests: each `-race -count=100` - `TestBuildShowAccountsSQL`: `-race -count=100` - complete owning-package race tests (`-race -count=1`), run serially: - `pkg/frontend`: 26.2s - `pkg/embed`: 116.7s - `pkg/util/test`: 1.1s - `pkg/iscp`: 1.2s - `pkg/objectio`: 2.1s - `pkg/vm/engine/test`: 171.9s
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…gin#26409) ## What type of PR is this? - [x] BUG - [x] Test and CI ## Which issue(s) this PR fixes Fixes matrixorigin#26107 ## What this PR does / why we need it This PR fixes three timing-sensitive race-UT failures by closing their timeout and asynchronous-state contracts. Successful paths do not sleep, and correctness is asserted from observable state transitions. ### Embedded Iceberg tenant setup `CREATE ACCOUNT IF NOT EXISTS` initializes tenant catalog/system tables and is safe to retry. The old helper used one 10s context for both the active SQL request and the whole retry loop. Once an attempt consumed that deadline, the retry path had no remaining budget. - bound each SQL attempt independently; - give the complete create operation a separate 30s budget; - stop immediately when the outer context expires; - retry only connection/transient errors; - validate retry policy and cover attempt expiry, outer expiry, cancellation, connection errors, and definitive SQL errors without short timing assertions. ### Object-count schema coverage `TestCalculateObjectCount` started a complete Log/TN/CN cluster only to verify whether the frontend-generated `SHOW ACCOUNTS` SQL includes `object_count`. Under race load, that exposed unrelated Dragonboat/HAKeeper bootstrap timing. The production decision and the SQL it controls now come from one helper. Focused tests validate and parse the actual generated SQL for: - sys tenant + metrics database + no `LIKE` (include `object_count`); - non-metrics database; - filtered sys queries; - non-system tenants, including preservation of the existing account-only filtering behavior. The full embedded-cluster test is removed; existing frontend tests continue to cover the projection itself. ### ISCP recovery test The old test used `Never(100ms)` to infer that an asynchronous failure happened, then removed the fault and waited up to 10s per watermark. It never proved that the worker had reached the intended fault, so scheduler load could make the injection disappear before it was exercised. In the reported run, recovery also crossed the fixed assertion deadline shortly after the transaction committed. Each injected phase now has an optional context-aware fault barrier: 1. install the barrier and the executor fault; 2. append the target transaction; 3. wait until a worker is observably parked at that exact fault; 4. assert the target watermark has not advanced; 5. remove the main fault before releasing all parked workers; 6. wait for all three watermarks under one 30s phase hang guard. All fault points have exactly-once cleanup, including `FailNow` paths. Normal production execution is unchanged because the barrier exists only when a test installs its keyed fault point. Failure evidence: https://github.com/matrixorigin/matrixone/actions/runs/30469746913/job/90636646900?pr=26161 ## Scope The earlier comment-only `optools/run_ut.sh` change was removed. This PR does not change package scheduling or globally serialize unrelated tests. ## Validation - CGo-configured `go build` for changed non-test packages - CGo-configured `go vet` for all owning packages - `make err-check` - `bash -n optools/run_ut.sh` - `git diff --check` - adaptive exact race tests: - `TestISCPExecutor4`: measured 5.32s, `-race -count=5` - six embedded account retry/deadline tests: each `-race -count=100` - `TestBuildShowAccountsSQL`: `-race -count=100` - complete owning-package race tests (`-race -count=1`), run serially: - `pkg/frontend`: 26.2s - `pkg/embed`: 116.7s - `pkg/util/test`: 1.1s - `pkg/iscp`: 1.2s - `pkg/objectio`: 2.1s - `pkg/vm/engine/test`: 171.9s
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes
Fixes #26107
What this PR does / why we need it
This PR fixes three timing-sensitive race-UT failures by closing their timeout and asynchronous-state contracts. Successful paths do not sleep, and correctness is asserted from observable state transitions.
Embedded Iceberg tenant setup
CREATE ACCOUNT IF NOT EXISTSinitializes tenant catalog/system tables and is safe to retry. The old helper used one 10s context for both the active SQL request and the whole retry loop. Once an attempt consumed that deadline, the retry path had no remaining budget.Object-count schema coverage
TestCalculateObjectCountstarted a complete Log/TN/CN cluster only to verify whether the frontend-generatedSHOW ACCOUNTSSQL includesobject_count. Under race load, that exposed unrelated Dragonboat/HAKeeper bootstrap timing.The production decision and the SQL it controls now come from one helper. Focused tests validate and parse the actual generated SQL for:
LIKE(includeobject_count);The full embedded-cluster test is removed; existing frontend tests continue to cover the projection itself.
ISCP recovery test
The old test used
Never(100ms)to infer that an asynchronous failure happened, then removed the fault and waited up to 10s per watermark. It never proved that the worker had reached the intended fault, so scheduler load could make the injection disappear before it was exercised. In the reported run, recovery also crossed the fixed assertion deadline shortly after the transaction committed.Each injected phase now has an optional context-aware fault barrier:
All fault points have exactly-once cleanup, including
FailNowpaths. Normal production execution is unchanged because the barrier exists only when a test installs its keyed fault point.Failure evidence: https://github.com/matrixorigin/matrixone/actions/runs/30469746913/job/90636646900?pr=26161
Scope
The earlier comment-only
optools/run_ut.shchange was removed. This PR does not change package scheduling or globally serialize unrelated tests.Validation
go buildfor changed non-test packagesgo vetfor all owning packagesmake err-checkbash -n optools/run_ut.shgit diff --checkTestISCPExecutor4: measured 5.32s,-race -count=5-race -count=100TestBuildShowAccountsSQL:-race -count=100-race -count=1), run serially:pkg/frontend: 26.2spkg/embed: 116.7spkg/util/test: 1.1spkg/iscp: 1.2spkg/objectio: 2.1spkg/vm/engine/test: 171.9s