Repository navigation
Do not hide setup and teardown errors of xfail integration tests - #132827
Merged
Merged
Conversation
pytest applies an `xfail` mark to every phase of a test, so an exception in a fixture of such a test is reported as an expected failure, and CI counts it as passed. When an `xfail` test was the last one of its module, the module fixture teardown that raised from `ClickHouseCluster.shutdown` was hidden. This hid a `Segmentation fault` of `node1` in `test_storage_paimon_with_spark` (`test_explicit_structure[azure]`, `test_primary_key_table[azure]`, NightlyCoverage on master `79929b2c`, 2026-11-15) and a `Logical error` in `test_database_iceberg/test.py::test_soak_delta_lake_insert_and_read`. Add a `pytest_runtest_makereport` wrapper that reports such errors in setup and teardown as errors. The mark keeps its meaning in the test body, and an explicit `pytest.xfail` call keeps its meaning in every phase.
Contributor
|
Workflow [PR], commit [b7014f8] Summary: ❌
AI ReviewSummaryThe change exposes setup and teardown errors from tests marked Final Verdict✅ Approve |
fm4v
enabled auto-merge
November 18, 2026 23:37
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.
pytest applies an
xfailmark to every phase of a test, so an exception in a fixture of such a test is reported as an expected failure, which CI counts as passed. When anxfailtest is the last one of its module, the module fixture teardown that raises fromClickHouseCluster.shutdown(a<Fatal>, aLOGICAL_ERRORor a sanitizer report in the server logs) is hidden. Real cases on master:test_storage_paimon_with_spark:test_explicit_structure[azure]andtest_primary_key_table[azure],Integration tests (amd_llvm_coverage_per_test, per_test_coverage, 6/8), master79929b2c(2026-11-15): teardown foundCrash in instance 'node1'withSegmentation fault, recorded asOK.test_database_iceberg/test.py::test_soak_delta_lake_insert_and_read: teardown foundLogical error: 'The base metadata file is not set...', recorded asOKon master and on IcebergOPTIMIZE TABLEcommits a new snapshot instead of rewriting the table #124114.This adds a
pytest_runtest_makereportwrapper intests/integration/conftest.pythat reports errors in setup and teardown ofxfail-marked tests as errors. The mark keeps its meaning in the test body (XFAIL, andXPASS(strict)still fails), and an explicitpytest.xfailcall keeps its meaning in every phase. Checked with pytest 9 on a throwaway project;ResultTranslator.from_pytest_jsonlthen reports the test asFAIL. Expect the two crashes above to show up in CI now.Related: #124114
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/132827]
Version info
26.11.1.2838-master(included in26.11and later)