Repository navigation
[torchci] Report C++ tests - #200025
Draft
georgehong wants to merge 19 commits into
Draft
[torchci] Report C++ tests#200025georgehong wants to merge 19 commits into
georgehong wants to merge 19 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200025
Note: Links to docs will display an error until the docs builds have been completed. ❌ You can merge normally! (6 Unrelated Failures), 4 Unclassified FailuresAs of commit 8138c4f with merge base 1fe73a1 ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Oct 7, 2026
georgehong
added a commit
that referenced
this pull request
Oct 7, 2026
C++ tests run as `pytest <binary>` under pytest-cpp rather than through run_tests, so run_test.py registers the plugin for them. A gtest is recorded as file cpp/<binary>, its gtest suite and test name, with language cpp; its declared name drops a value-parameterized /N suffix. pytest-cpp runs each gtest in its own process and reports a crash as an ordinary failure, so the writer recognizes the "returncode=-N" message and records crashed. Test Plan: ``` python test/test_testing.py -k TestReport -k TestJunitXml python -m pytest test_demo -n 1 -p torch.testing._internal.torchci.plugin --torchci-report-dir=r # a gtest binary with a crashing test lintrunner ``` Authored with the help of an AI assistant (Claude). ghstack-source-id: cf697d3 Pull-Request: #200025
This was referenced Oct 12, 2026
georgehong
added a commit
that referenced
this pull request
Oct 14, 2026
C++ tests run as `pytest <binary>` under pytest-cpp rather than through run_tests, so run_test.py registers the plugin for them. A gtest is recorded from its pytest-cpp item as file cpp/<binary>, its gtest suite and test name, with language cpp; its declared name drops a value-parameterized /<param>. A gtest whose process crashed is failed, with pytest-cpp's message, as in junit. run_test.py runs C++ tests under xdist with -x, which stops right after the final failing report, before the teardown report where the writer writes the run. Runs whose failure is already known are now written at session end; without that, the failure that stops a C++ run was missing from its report. An xdist worker that dies isn't recorded. pytest-rerunfailures sends a test's reports only after each attempt, so the controller never has the identity of the test the worker was running, and its node id can't give the declared name of PyTorch's generated tests, which the test's id hashes. junit and the log still have it. Test Plan: ``` python test/torchci/test_testing.py CPP_TESTS_DIR=<dir with a gtest binary> python test/run_test.py --cpp -i cpp/<binary> --save-torchci-reports <dir> lintrunner ``` Authored with the help of an AI assistant (Claude). ghstack-source-id: 9d2e0dd Pull-Request: #200025
Contributor
Author
|
Succeeded by #200980, using this PR as a playground to understand failing tests (if attributable to the reporter). |
This branch has not been 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.
Stack from ghstack (oldest at bottom):
Summary
Report C++ tests. They run under pytest-cpp rather than run_tests, so run_test.py registers the report plugin for them, and each gtest is named from its pytest-cpp item (file
cpp/<binary>, gtest suite and test name, languagecpp). C++ tests also run under xdist with-x, which stops before the final failure's teardown report, so runs with a known failure are now written when the session ends. As in junit, a crashed gtest isfailedwith pytest-cpp's message; xdist worker deaths aren't recorded.A gtest's
fileis its binary, since one source can be compiled into several binaries, but owners are keyed by source file. So each run also recordsdef_file, the repo-relative file that defines the test. While pytest-cpp collects a binary, the plugin setsGTEST_OUTPUT, so the--gtest_list_testsit already runs also writes JSON with each test's file. gtest records the absolute path the build compiled, so the writer keeps the longest suffix of it that is a file in the checkout the tests run from.def_fileis best effort: it's""when nothing matches, as for the hipified copies ROCm builds compile, and for Python tests. The replicator ignores it untilrunshas the column.For now, this draft writes reports from every CI workflow (
IS_CI) to find tests the writer breaks; it goes back to pull and trunk before landing.Test Plan
End to end: this PR's CI, with C++ reports from the
test_libtorchshards, including Windows viaciflow/trunk.Authored with the help of an AI assistant (Claude).