Skip to content

ci: upload UT diagnostics on failure - #449

Merged
XuPeng-SH merged 10 commits into
mainfrom
codex/ut-diagnostics-artifact
Sep 11, 2026
Merged

XuPeng-SH merged 10 commits into
mainfrom
codex/ut-diagnostics-artifact

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

When a MatrixOne UT job times out or is cancelled, the runner preserves partial evidence under ut-report and helper streams under scratch. Upload those files as a short-lived, shard-specific artifact so a timeout can be downloaded and analyzed after the log window is gone.

The failure/cancellation artifact includes:

  • checkpoint, stderr, active/slow summaries, and the merged partial JSON under ut-report
  • the full UT log
  • light, engine, plan (including shard suffixes), and embedded prebuild helper reports

The runner normally snapshots the main JSON into ut-report using a same-filesystem hard link where possible, so the raw scratch copy is not uploaded twice. A best-effort pre-upload fallback recovers the nested scratch main report when an outer kill reaches cleanup before that snapshot exists.

The upload copy is bounded to 250 MiB total, including a 64 KiB manifest reserve. Files beyond the budget retain a marked head/tail fragment, and manifest.txt records original/stored sizes and omitted entries. The source reports remain untouched. Recovery is capped at 2 minutes and upload at 5 minutes. Diagnostic artifacts are retained for 1 day.

Successful UT jobs upload only the small top.txt and checkpoint baseline for 1 day. This provides historical stage/slow-case comparison without copying the raw JSON on every successful run.

The recovery, staging, upload, and baseline steps are best effort and do not change the authoritative UT result. Missing diagnostics are warned and ignored.

Validation:

  • YAML parsed successfully with Ruby
  • inline staging Python extracted and compiled successfully
  • synthetic over-budget staging verified head/tail truncation, manifest limits, and total-byte accounting with 5,000 files
  • git diff --check passes

@XuPeng-SH
XuPeng-SH merged commit e43e707 into main Sep 11, 2026
1 check passed
@XuPeng-SH
XuPeng-SH deleted the codex/ut-diagnostics-artifact branch September 11, 2026 00:01
XuPeng-SH added a commit to matrixorigin/matrixone that referenced this pull request Sep 11, 2026
## Problem

The single-runner race UT job can hit its outer timeout while the log
only shows the last foreground line. A partial run needs to tell us
which stage was active, which cases completed slowly, which cases were
still active, and where the raw evidence is stored.

## Change

- Keep the bounded single-runner UT schedule: HNSW completes first,
light runs in a private report helper, and the issues package may
overlap only through the explicit opt-in path (`UT_OVERLAP_LIGHT=0`
remains the default).
- Emit an append-only checkpoint for stage, package, process, admission,
cancellation, and report ownership events.
- Emit a bounded heartbeat every 60 seconds with current stage/label,
active cases discovered from foreground and helper/shard reports,
process count, and cgroup memory current/peak.
- On timeout, cancellation, or test failure, preserve the partial Go
JSON stream, checkpoint, stderr, and a top-20 summary of completed slow
tests/packages. Active/incomplete cases are reported separately;
truncated UTF-8/JSON lines do not discard the preceding events.
- Stop child process groups and the heartbeat with bounded waits before
collecting diagnostics; preserve helper reports until their single-owner
merge succeeds.
- Add scheduler, cancellation, parser, and heartbeat tests. A companion
CI workflow change uploads `ut-report` and the raw
`scratch/*-UT-Report.out` files on failed/cancelled jobs for download
(matrixorigin/CI#449).

## Validation

- `bash -n optools/run_ut.sh`
- `python3 -m py_compile optools/summarize_ut_slow_cases.py`
- `go test ./optools -count=1`
- `go test -race ./optools -count=1`
- `git diff --check`

The scheduler change is opt-in until a same-runner A/B proves wall-time
and resource benefit. The diagnostic path is active for all UT runs and
does not change test coverage or the authoritative test result.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant