From 2a17b11d769733e3a3f76f95c6a1c85ec613188b Mon Sep 17 00:00:00 2001 From: davem-bis <68955845+davem-bis@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:15:06 +0000 Subject: [PATCH 1/2] Added an isolated marker to any pytest making use of the cap fixtures. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> --- Makefile | 6 +++--- tests/conftest.py | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b5aebb53b5..ac97179a81 100644 --- a/Makefile +++ b/Makefile @@ -133,13 +133,13 @@ engine-up: engine-clickhouse-up engine-mssql-up engine-mysql-up engine-postgres- engine-down: engine-clickhouse-down engine-mssql-down engine-mysql-down engine-postgres-down engine-spark-down engine-trino-down fast-test: - pytest -n auto -m "fast and not cicdonly and not isolated" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated and not slow and not fork_isolated" && pytest tests/test_forking.py::test_parallel_load -m "isolated and fork_isolated and not slow" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and fork_isolated and not slow" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" + pytest -n auto -m "fast and not cicdonly and not isolated" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated and not slow and not fork_isolated and not docker and not remote" && pytest tests/test_forking.py::test_parallel_load -m "isolated and fork_isolated and not slow" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and fork_isolated and not slow" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" slow-test: - pytest -n auto -m "(fast or slow) and not cicdonly and not isolated" && pytest -m "isolated and not fork_isolated" && pytest tests/test_forking.py::test_parallel_load -m "isolated and fork_isolated" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and fork_isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" + pytest -n auto -m "(fast or slow) and not cicdonly and not isolated" && pytest -m "isolated and not fork_isolated and not docker and not remote" && pytest tests/test_forking.py::test_parallel_load -m "isolated and fork_isolated" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and fork_isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" cicd-test: - pytest -n auto -m "(fast or slow) and not pyspark and not isolated" --junitxml=test-results/junit-cicd.xml && pytest -m "pyspark" && pytest -m "isolated and not pyspark and not fork_isolated" && pytest tests/test_forking.py::test_parallel_load -m "isolated and not pyspark and fork_isolated" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and not pyspark and fork_isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" + pytest -n auto -m "(fast or slow) and not pyspark and not isolated" --junitxml=test-results/junit-cicd.xml && pytest -m "pyspark" && pytest -m "isolated and not pyspark and not fork_isolated and not docker and not remote" && pytest tests/test_forking.py::test_parallel_load -m "isolated and not pyspark and fork_isolated" && pytest tests/test_forking.py::test_parallel_load_multi_repo -m "isolated and not pyspark and fork_isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated" core-fast-test: pytest -n auto -m "fast and not web and not github and not dbt and not jupyter" diff --git a/tests/conftest.py b/tests/conftest.py index 1f7f6d9325..c088bf089b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -211,9 +211,24 @@ def pytest_collection_modifyitems(items, *args, **kwargs): "registry_isolation", "dialect_isolated", } + + # These are built in Pytest fixtures that capture output as documented here: https://docs.pytest.org/en/stable/reference/fixtures.html + # Due to the use of the clear() functionality within the test suite, tests that use these fixtures can collide with each other by + # clearing each others captured outputs, so the these are marked as isolated. + non_thread_safe_fixtures = frozenset( + { + "caplog", + "capsys", + "capsysbinary", + "capfd", + "capfdbinary", + "capteesys", + } + ) + for item in items: - if "capsys" in item.fixturenames: - # capsys is not threadsafe, so the test must be isolated. + if bool(non_thread_safe_fixtures & set(item.fixturenames)): + # Ensure that any tests using non-threadsafe fixtures are isolated. item.add_marker("isolated") for marker in item.iter_markers(): if marker.name in test_type_markers: From 03e1a8d2b145e2aa56a746964501883748a975ef Mon Sep 17 00:00:00 2001 From: davem-bis <68955845+davem-bis@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:15:35 +0000 Subject: [PATCH 2/2] Extended timeout on concurrency tests to allow for tests to pass on machines with limited resources. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com> --- tests/utils/test_concurrency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/test_concurrency.py b/tests/utils/test_concurrency.py index 0d45a375f1..04f9748fd7 100644 --- a/tests/utils/test_concurrency.py +++ b/tests/utils/test_concurrency.py @@ -168,7 +168,7 @@ def _run_bounded_python(program: str) -> None: env=env, capture_output=True, text=True, - timeout=8, + timeout=16, ) assert result.returncode == 0, f"{result.stdout}\n{result.stderr}"