Skip to content

[4.2-dev] test: restore coverage and reduce UT/BVT time and I/O - #32747

Merged
XuPeng-SH merged 5 commits into
4.2-devfrom
codex/32744-42-ci-io
Nov 15, 2026
Merged

XuPeng-SH merged 5 commits into
4.2-devfrom
codex/32744-42-ci-io

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Improvement
  • Test and CI

Which issue(s) this PR fixes:

Part of #32744; related to #32718. Supersedes #32721. These trackers should not be closed based on this PR alone.

What this PR does / why we need it:

Consolidate the race UT fixes and coverage restoration, and reduce repeated fixture work, test logging and BVT waiting. The existing UT phase layout and runner count are unchanged: the extra serialized embedded-cluster phase from the previous revision is removed. The cold invalid-timestamp recovery setup also remains intact. Recent CI results show substantial fixed and configuration-dependent time, so the local case savings below are not treated as full-job savings.

Scenario mapping

Before After and coverage boundary
First CN replay can compete with LOG/TN startup before the fault is exercised. Start LOG/TN, wait for a TN shard and then start the faulted first CN. Preserve the disconnect, resume timestamp, SQL and prepared-reader assertions. Join startup before closing services, removing data or releasing the admission lease.
Changed-list coverage before #32700 included three independently created CN objects with two full blocks each; a separate 150-row varchar test was also removed. Restore all three 16,384-row CN objects and pair each with its own flushed two-row TN object before one of three checkpoints. Keep the independent 150-row varchar case and the existing two-row selector. Verify changed IDs, checkpoint boundaries and row results.
Missing-table subscription called the mocked RPC 1,000 times with 5 ms pacing and repeated error logging. Retain 1,000 actual mock-RPC cycles and assert the missing error and cleaned state for each. Test transient retry, cancellation and pending subscription separately; the inter-attempt timing is intentionally different. The mock stream observes context cancellation when its send blocks.
Checkpoint merge generated 100,000 uniform historical table IDs. Keep the same account, database, sequential-ID and timestamp shape, but use 16,401 rows. In the measured runs, both cases wrote one object with multiple 8,192-row blocks and a partial final block; assert at least three persisted blocks, every ID, timestamps, user rows and the special coverage row. The 100,000-row / 13-block stress volume is reduced and is not claimed to be equivalent.
Publication tests needed DEBUG-path coverage, and test-owned change-handle batches outlived their engines. Scope DEBUG configuration and retain DEBUG guards, field encoding and trace reporting, but suppress DEBUG console entries in nine selected tests, including on failure; INFO/WARN/ERROR remain. Release the three batches after engine teardown. A caller already using DEBUG keeps console DEBUG output.
FK database-copy regression built the same source separately for each copy mode and identifier. Reuse one source per underscore/percent/backslash case, retain all six named data-branch/clone subtests and each target, metadata, data, collision and FK-error assertion. Check source rows again before reuse. The source now survives across the two modes and therefore has different catalog history.
Fulltext and IVF-FLAT clone/restore BVT cases each slept for 30 + 30 + 45 seconds. Keep all original input rows, clone operations, searches and expected results. Fulltext waits for source and cloned search results; IVF-FLAT waits for source entries, a newer clone model with six active entries and then eight entries after insertion. This adds readiness assertions and changes when results are observed. The BVT script set and grouping/order remain unchanged.

Measured impact and limits

  • On one shared host, precompiled -race -short -tags=matrixone_test binaries ran 11 selected engine cases in strict ABBA order: baseline 41.542 / 39.900 s; candidate 36.591 / 37.701 s. Captured output fell from 4.73–4.77 MB to 2.77–2.78 MB. Process write counters include captured output and are not device-wide I/O measurements.
  • The checkpoint case itself measured 1.15 / 1.14 s before and 0.66 / 0.67 s after in the same style of comparison. These samples do not establish full-lane I/O savings.
  • The earlier [4.2-dev] test: restore coverage and reduce UT/BVT time and I/O #32747 race job took 77m19s: its exclusive phase took about 27m49s and its added serial embedded-cluster phase took about 15m35s. The current head passed in 43m39s, with 42m05s in the Unit Testing step. Removing the added phase does not imply a 15m35s saving: its packages still run in the existing phases. After testing, the gap between the analysis tool's first and next dependency-download messages was 476s in the older run versus 4–27s in four other runs; the cause is not established. Checkout, native build, report tooling and other fixed costs are outside the individual case measurements. The full-job results are independent samples, not a controlled attribution.
  • The non-race UT coverage job's raw report was 197,479,585 bytes for this head versus 205,342,435 bytes in the earlier [4.2-dev] test: restore coverage and reduce UT/BVT time and I/O #32747 run; runner execution was 1,092.9 s versus 1,076.1 s. These are single runs on different revisions/environments, not an attribution or a race-lane comparison.
  • With the CI mo-tester revision on a local three-CN embedded cluster, the fulltext case measured 105.192 / 108.566 s before and 24.275 / 30.249 s after (ABBA). The IVF-FLAT case measured 106.700 s before and 50.264 / 40.255 / 32.557 s after across two local cluster runs; it also took about 105 s in recent CI artifacts. The standalone fulltext comparison enabled the feature in its session. These are case timings, not CI job wall times.
  • Actual group-1 pessimistic BVT: in run 43553630723 the fulltext and vector scripts took 105.190 / 105.279 s; in run 43631272327 on this head they took 30.247 / 36.368 s, all passing. The BVT step was 30m46s versus 28m19s and the whole job 33m36s versus 30m55s. These are single independent CI runs, so the total job difference cannot be attributed solely to those cases.
  • In four recent BVT runs the proxy job took 32m05s–36m36s and the pessimistic job 23m17s–34m12s; the proxy job was longer with either group assignment. In the current run the proxy job passed in 35m12s, versus 35m17s in the older comparison run, so the pessimistic-case savings did not translate into a comparable BVT critical-path reduction in these samples. The group assignment rotates between configurations, so a static group move could improve some runs and regress others.
  • The grouping script is unchanged and declares 823 + 456 distinct scripts in both runs, with no overlap. The tester actually started 817 + 456: the same six partition scripts were already marked @skip:issue#16438 and reported zero commands in both runs. The declared and executed sets are identical before/after, with no new skip or duplicate. The per-command ignored counts were also unchanged at 443 and 659 respectively.

Validation

  • Rebased on the latest observed 4.2-dev; gofmt, git diff --check, and make static-check-selected (repository molint and golangci-lint) passed for the changed Go packages.
  • -short -race -tags=matrixone_test: complete pkg/logutil, pkg/vm/engine/disttae, pkg/vm/engine/test/testutil, pkg/vm/engine/test, pkg/tests/issues, and pkg/embed/firstreplay packages passed. TestMarkScanGuardSQL passed twice.
  • Under race: 100 repetitions of the logger, mock-stream, replay control-plane/cleanup and missing-table cleanup checks; 10 repetitions of the subscription, transient retry and changed-list cases; two repetitions of TestCNFirstReplayDisconnect; and 30 repetitions of TestCheckpointTableIDBatch2 with a private /tmp mount.
  • The complete pkg/vm/engine/tae/db/test package passed under race (248 passed, 13 existing skips) with a private /tmp mount because its test helper uses hard-coded paths under /tmp; this PR adds no skips.
  • Both changed BVT scripts passed with the real mo-tester and three CNs. A vector negative control first observed eight indexed rows, then deliberately expected nine: it failed exactly that assertion and the tester exited nonzero.
  • In one mo-tester session, each changed BVT script also passed immediately after its historical predecessor (four scripts in order, zero failures or ignored commands); the standalone session enabled the fulltext feature as the earlier group scripts do.
  • CI run 43631272327 passed UT race, both BVT groups and UT coverage. The ARM static-analysis job is still running.

The race job met the one-hour target in this run; additional CI samples are needed to assess its stability.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 14, 2026 03:50
@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 →

@mergify

mergify Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: ecbd9e02e8d9271c34bde6049c657c82c1d656fb

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: ecbd9e02e8d9271c34bde6049c657c82c1d656fb

Assessment: approve

The scoped CI and fixture changes preserve the replay, multi-batch checkpoint and ISCP recovery oracles. They reuse the existing package graph and phase runner, reduce fixture cost, and keep cleanup ownership ordered without adding product mechanisms.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed all seven changed files, the complete three-entry discussion and linked tracker #32744; traced runner/report propagation, manual service startup/close, checkpoint writer/reader boundaries and the unchanged invalid-timestamp barrier.

  • Private /tmp and loopback preflight passed. optools normal and race runs passed eight roots and twelve subtests with an explicitly retained diagnostic overlay adding only -buildvcs=false to two temporary-module subprocesses. The unmodified full-package attempts failed VCS discovery beneath the harness's protected Git marker; they are not passes.

  • Unmodified TestRaceRunnerPhasesAndFailureStatus passed 71 race repetitions (T=0.42s, B=30s). go vet ./optools, bash syntax, changed-file gofmt and frozen-source/patch checks passed; command receipts and retained logs are reconciled in validation-manifest.json.

  • Reused supplied author reports for firstreplay normal/race package checks, replay/helper stress, checkpoint and invalid-timestamp focused normal/race repetitions and negative controls. These native tests were not rerun locally.

Limitations:

  • Native validation is author-reported; local_validation contains no raw execution artifacts. Full race UT and Compose CI remain pending in the frozen evidence.

  • Full-lane duration against the 90-minute limit and a common contention root cause are not established. The reported process write-byte reduction is a scoped measurement, not physical-device or whole-lane evidence.

@XuPeng-SH
XuPeng-SH force-pushed the codex/32744-42-ci-io branch from ecbd9e0 to ca614a9 Compare November 14, 2026 19:17
@XuPeng-SH XuPeng-SH changed the title [4.2-dev] test: reduce race UT resource contention [4.2-dev] test: restore coverage and reduce UT/BVT time and I/O Nov 14, 2026
@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/L Denotes a PR that changes [500,999] lines labels Nov 14, 2026
@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · superseded

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Review linked issue or PR description changed before publication; a fresh contextual review is queued.

@XuPeng-SH

XuPeng-SH commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: ca614a9bfb5f1b6fc0c92aab10048d141aa10f64

Assessment: approve

The changes preserve required coverage and cleanup while reusing existing owners. The BVT clarification introduces no actionable finding.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Completed the 19-file review and assessed all nine discussion entries and linked requirements.

  • Reconciled retained same-head normal/race logger tests, seven adaptive race sets and vet with original receipts and logs.

  • Current source, formatting, SQL-oracle and evidence checks passed.

  • Static inventory confirms disjoint groups of 823/456 scripts, six pre-existing skips and both changed cases active.

Limitations:

  • Native tests were not independently rerun; libmo.so remains absent.

  • Actual BVT execution/ignored counts and newer CI outcomes remain author-attributed; the embedded snapshot is nonterminal.

  • Raw author logs and the incidental #16438 issue body were unavailable; skip preexistence was verified from frozen source.

@XuPeng-SH

XuPeng-SH commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 86ff145ecf9dc371614eabfa192ef23a06ee9390

Review completed. Read the assessment.

@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.

mo-bot review · mo-bot-local · review

Commit: 86ff145ecf9dc371614eabfa192ef23a06ee9390

Assessment: approve

The changes retain meaningful coverage while reusing existing fixture, logger and readiness owners. Quiet logging preserves cleanup and trace semantics. No actionable correctness or design issues remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed all 19 changed files, affected consumers, all 11 discussion entries and linked requirements.

  • Logutil normal and race runs each passed 42 roots and 96 root/subtest events. Eight adaptive race selections passed 643 root repetitions; vet passed.

  • Source, formatting, SQL-oracle and evidence audits passed. BVT groups remain disjoint at 823/456 declared scripts, with six unchanged skips. Receipts and logs are reconciled in validation-manifest.json.

  • Isolation preflight passed. Local native validation stopped before compilation because libmo.so was missing.

Limitations:

  • Native/BVT execution remains author-attributed; raw logs were unavailable. Relevant jobs in the frozen current-head CI snapshot remain pending.

  • Local checks used Go 1.26.6; the module requires 1.26.4.

  • Reported case/output savings do not establish full-lane causal improvement or one-hour stability.

This branch was previously deployed

1 inactive deployment
ci — 86ff145e Deployed Nov 15, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement kind/test-ci size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants