Skip to content

fix(ci): distinguish exited UT cases from live tests - #33050

Merged
XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/32745-main-ut
Nov 22, 2026
Merged

XuPeng-SH merged 5 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/32745-main-ut

Conversation

@XuPeng-SH

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

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Improvement
  • Test and CI

Which issue(s) this PR fixes:

Refs #32745 (FLAKY-003). The underlying whole-suite deadline and other failure signatures stay tracked there.

What this PR does / why we need it:

In this Race job, LogService exited at 14:58 UTC but its unfinished test appeared in 90 later heartbeats, including the last heavy wave at 16:42 UTC.

  • Retire unfinished tests from the live heartbeat when their package exits. Preserve test names, start times, and the package result in the failure summary. Merged streams with overlapping package invocations report ambiguous attribution explicitly.
  • Reuse the report publisher's ready-marker rule in the heartbeat. Keep torn records from consuming the next shard's first event. Preserve the raw report and give the pinned analyzer readable records when the raw input contains malformed lines.
  • Generate the slow and lifecycle summaries in one pass. A stopped writer’s final, valid JSON event can end at EOF. Live heartbeat reads and failure reports from an undrained writer still require the newline. Keep the existing test selection, concurrency, and time budgets.
  • Require the heartbeat regression to observe a successful classification before exercising the unavailable-classifier fallback. Advance one tick per phase and wait until its checkpoint is written.

On the retained 262 MB Race report, the LogService case disappeared from the heartbeat and was preserved as unfinished after package failure. Three paired local replays reduced median failure-summary generation from 3.57 s to 1.84 s with byte-identical slow-case output. Slow-case output was also byte-identical on a separate Coverage-format input. These measurements cover report generation. The LogService panic and the full-suite timeout remain outside this fix.

On Linux with Go 1.27.1, the complete optools package passed race UT, including the fallback and foreground EOF paths. Incremental static checks and 12 Python regression tests passed. The rebased revision also passed a negative control: forcing classification to fail in the healthy phase passed the previous test and fails the corrected one.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 21, 2026 17:59
@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 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 262bbde0f4246c6de313385d5e0ffbb083a4eab1

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: 262bbde0f4246c6de313385d5e0ffbb083a4eab1

Assessment: request_changes

The shared lifecycle reader retires exited cases, and the heartbeat uses the same ready-marker rule as report publication. The torn-record marker breaks the pinned failure analyzer and can discard the failed test artifacts for an otherwise readable report.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

  • P2 optools/ut_process.bash:171: The last shard stops after writing a complete JSON event but before writing its newline. The merge appends the literal incomplete-record marker and publishes the resulting file as the UT report.
    Impact: The pinned analyzer panics while reading the merged report, before it writes failed test names and outputs. Those artifacts can disappear even for complete failure events that precede the torn write.
    Evidence: optools/run_ut.sh:3550 passes the merged file to go-ut-analysis, which aborts on any invalid JSON line. The probe passed a report with a complete test failure and a package terminal whose newline was missing. The merge base copy behavior let the actual pinned analyzer exit 0 and write failed/outputs/pkg/TestOtherFailure. copy_ut_report_chunk made the same analyzer exit 2 with an empty failure artifact set. See torn-tail-probe.log and checks/1795284930442877688-3.json. Keep the torn bytes in raw diagnostics and preserve valid event records for the downstream analyzer.

Validation:

  • The complete optools package passed under the race detector in optools-race-retry.jsonl, receipt 1795285072952202959-2.json. The earlier invocation reached its foreground limit during dependency setup and was retried after module download.

  • Ten Python tests and both shell syntax checks passed. See python-ut.log and shell-syntax.log with receipts 1795284799823076202-2.json and 1795284809341147263-3.json.

  • The pinned go-ut-analysis comparison reproduced the missing failed-test artifact. See analyzer-install.log and torn-tail-probe.log with receipts 1795284895538977361-2.json and 1795284930442877688-3.json.

Limitations:

  • The full race workflow and the author's 262 MB timing replay were not run locally. The suite deadline remains tracked by #32745.

@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 7c20e206cb1e3a4d063b1c9427f18b4ec08b90fb

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: 7c20e206cb1e3a4d063b1c9427f18b4ec08b90fb

Assessment: request_changes

The shared lifecycle reader retires exited tests from heartbeats, and the pinned analyzer now preserves failure artifacts across torn report lines. Final lifecycle replay still drops a complete package exit event when only its trailing newline is missing.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

  • P3 optools/summarize_ut_slow_cases.py:108: A foreground UT writer exits after writing a complete package failure event without its final newline, and the report goes directly to the failure summary without a helper merge.
    Impact: The slow summary records the package failure, but the lifecycle summary still labels its unfinished test active and omits the package result.
    Evidence: The foreground-runner probe joined the writer before summarizing. Adding one newline changed the lifecycle output from active UT case to unfinished UT case at package exit with package_result=fail. See terminal-tail-compare.log and checks/1795293723857211339-4.json. Accept complete, decoded final records in failure replay while retaining the newline requirement for live heartbeat reads.

Validation:

  • Verified the frozen head and delta. Bash syntax and git diff checks passed. See frozen-source.log and shell-and-diff.log with receipts 1795293738994770296-3.json and 1795293577277671515-3.json.

  • All 10 Python lifecycle tests passed. See python-ut.log and receipt 1795293577426488927-3.json.

  • The full optools package passed in normal and race modes after executor preflight. See optools-normal.jsonl and optools-race.jsonl with receipts 1795293843849693609-3.json and 1795293615065350634-3.json.

  • Under the race detector, all 11 heartbeat iterations and 100 torn-shard iterations passed. See heartbeat-race.jsonl and plan-torn-race.jsonl with receipts 1795293803953640966-3.json and 1795293784132856268-3.json.

  • The runner probe used the pinned analyzer and recovered failed-test outputs on both sides of a torn line while preserving the raw report. A clean report passed, and a malformed report with go-test status zero still failed validation. See analyzer-probe.log and receipt 1795293643656049100-3.json.

Limitations:

  • Torn-write behavior was tested with controlled report fixtures. The full MatrixOne Race workflow and the author's 262 MB timing replay remain outside local execution evidence.

@XuPeng-SH

XuPeng-SH commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 4e8b032dc13643e326b83b50b99f95c158c3a6e1

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: 4e8b032dc13643e326b83b50b99f95c158c3a6e1

Assessment: request_changes

The shared lifecycle reader and report framing address both prior findings. The pinned analyzer preserves failed-test artifacts across torn records, and final replay accepts a complete terminal event at EOF after the writer drains. One regression remains in the heartbeat test’s success assertion.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

  • P3 optools/ut_schedule_test.go:1190: The incremental classifier fails during the first phase of TestUTHeartbeatStopsCleanly, which is intended to verify that three live cases are discovered.
    Impact: The test can pass with both phases reporting unknown activity. CI would miss a regression that disables successful heartbeat classification.
    Evidence: The readiness condition now accepts either the three expected cases or active_cases=unknown. The positive greps at lines 1233–1236 do not control the shell’s exit status. A controlled classifier failure reached the first phase and the test still passed under -race. See heartbeat-unavailable-injections.log, heartbeat-unavailable.jsonl and receipt 1795295506060624213-6.json. Require the three expected cases in the first phase and accept unknown only after injecting failure.

Validation:

  • Executor preflight passed. The frozen patch matched the checkout after restoring its final newline. Git diff checks, both Bash syntax checks and all 12 Python tests passed. Receipts 1795295336312584009-3.json and 1795295382099320220-3.json.

  • On Linux with Go 1.27.1, all 122 top-level optools tests passed under -race. The heartbeat and torn-shard tests passed 12 and 100 focused iterations, respectively. Receipts 1795295385681817357-3.json, 1795295505508599332-3.json and 1795295483130323425-3.json.

  • The pinned analyzer recovered failed-test outputs on both sides of a torn record while preserving the raw report. The runner accepted a clean control and rejected a malformed report with test status zero. Receipt 1795295410520854799-4.json.

  • The combined replay produced byte-identical slow summaries against the base on 3,798 local race events. Changed-file formatting, go vet and scoped golangci-lint passed. Receipts 1795295525299577996-3.json, 1795295435387254600-3.json and 1795295542542717839-3.json.

Limitations:

  • Local validation covered the reporting harness and controlled failure inputs. The full MatrixOne Race and Coverage workflows and the author’s 262 MB timing replay were outside local execution.

@XuPeng-SH

XuPeng-SH commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: d53bd1b945796223b4e9bf9c4d3b8f47a089892e

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: d53bd1b945796223b4e9bf9c4d3b8f47a089892e

Assessment: approve

All three prior findings are resolved. The heartbeat test waits for the checkpoint, requires three named live cases, and verifies the unavailable-classifier fallback in a separate phase. The shared lifecycle reader and report framing preserve final EOF classification and failed-test artifacts.

Model: gpt-6.2-sol / xhigh

Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3

Validation:

  • Isolation preflight, frozen-source checks, Bash syntax checks, and all 12 Python tests passed. Receipts 1795308794986344280-3.json and 1795308814048260773-3.json.

  • All 122 top-level optools tests and 69 focused heartbeat repetitions passed under race. Injecting a classifier failure in the healthy phase produced an unknown-activity checkpoint and failed the assertion with exit status 93 as expected. Receipts 1795308851720808958-3.json, 1795308898550298962-3.json, and 1795308850142637841-5.json.

  • Formatting, go vet, and scoped golangci-lint passed. Receipt 1795308890978566444-3.json.

  • Verified that the report-processing inputs match the previous review and reused its pinned-analyzer and byte-identical slow-summary comparisons. See validation-audit.log.

Limitations:

  • Local execution covered the reporting harness. The full MatrixOne Race and Coverage jobs were still in progress in the frozen snapshot, and the author’s 262 MB timing replay was outside local validation.

This branch was successfully deployed

No deployments
ci — 0d83b635 Deployed Nov 22, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/enhancement kind/test-ci size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants