Skip to content

[torchci] Remove the report of a session that starts no test - #201118

Closed
georgehong wants to merge 1 commit into
gh/georgehong/28/basefrom
gh/georgehong/28/head
Closed

georgehong wants to merge 1 commit into
gh/georgehong/28/basefrom
gh/georgehong/28/head

Conversation

@georgehong

@georgehong georgehong commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Summary:
A pytest session that never starts a test, such as run_test.py's serial pass over a file without serial tests, now removes its report when it ends. Such a report holds only the report line, so it adds no rows, but each one is still uploaded and ingested; removing them cuts that ingest traffic.

The report is kept whenever a test started, so the crash and timeout handling from #200942 is unaffected: run_test.py only appends a run the writer published when its test started. A session whose writer turned itself off, or a process that dies before its first test, still leaves its report.

Not session.testscollected == 0: under xdist it's the last worker's count, so if a crashed worker's replacement collects nothing, it could delete a report that already has runs.

Test Plan:

CUDA_VISIBLE_DEVICES= python test/torchci/test_testing.py -v
python test/run_test.py --cpp -i cpp/c10_typeid_test --save-torchci-reports <dir>

test_session_without_tests_leaves_no_report covers sessions that start no test, with and without xdist; the existing TestReportCrashes tests cover the reports that must be kept. The C++ launch now leaves one report instead of two.

Authored with the help of an AI assistant (Claude).

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201118

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit a546206 with merge base df9e46a (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - PR requires human review:

  • Triviality
    • New behavior in ReportWriter.pytest_sessionfinish: os.remove(self.path) when started_test is false, so a session that starts no test now leaves no report file
    • It is an ingest-traffic optimization, not a bug fix, so it fits none of the trivial classes
  • Socialization
    • It changes which report files reach the tests.* ClickHouse tables: report lines from sessions that start no test stop arriving
    • Consumers outside this repo may count report lines as evidence that a process ran, so a human should confirm none does
  • Correctness
    • Looks sound: started_test is set in pytest_runtest_logstart before the _disabled check, and the new test covers runs with and without xdist (-n 1)
    • The crash and timeout path in append_run returns early on FileNotFoundError, and those reports are kept anyway once a test has started

reason: not_trivial
Reviewed commit: a546206

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@georgehong georgehong added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Oct 15, 2026
@georgehong
georgehong requested review from huydhn and jathu October 15, 2026 22:33
@georgehong
georgehong marked this pull request as ready for review October 15, 2026 22:36
@georgehong

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

georgehong added a commit to pytorch/test-infra that referenced this pull request Oct 16, 2026
At 50%, with the fortesting.tests check fix (#9134) and the removal of
header-only reports (pytorch/pytorch#201118), fortesting ingest resource
usage is significantly reduced, and it should be safe to continue
rollout.

Remaining follow-ups: 
- materialized view optimization/ClickHouse infra changes
- long tail of workflows and upload steps, although most rows should be
accounted for after this.

Authored with an AI assistant (Claude Code).
majing921201 pushed a commit to majing921201/pytorch that referenced this pull request Nov 16, 2026
…#201118)

**Summary:**
A pytest session that never starts a test, such as run_test.py's serial pass over a file without serial tests, now removes its report when it ends. Such a report holds only the report line, so it adds no rows, but each one is still uploaded and ingested; removing them cuts that ingest traffic.

The report is kept whenever a test started, so the crash and timeout handling from pytorch#200942 is unaffected: run_test.py only appends a run the writer published when its test started. A session whose writer turned itself off, or a process that dies before its first test, still leaves its report.

Not `session.testscollected == 0`: under xdist it's the last worker's count, so if a crashed worker's replacement collects nothing, it could delete a report that already has runs.

**Test Plan:**
```
CUDA_VISIBLE_DEVICES= python test/torchci/test_testing.py -v
python test/run_test.py --cpp -i cpp/c10_typeid_test --save-torchci-reports <dir>
```
`test_session_without_tests_leaves_no_report` covers sessions that start no test, with and without xdist; the existing `TestReportCrashes` tests cover the reports that must be kept. The C++ launch now leaves one report instead of two.

Authored with the help of an AI assistant (Claude).
Pull Request resolved: pytorch#201118
Approved by: https://github.com/jathu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants