From 1d5f857505392486b7cf97684787a8a69c562fba Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 13 Feb 2024 12:17:51 +0100 Subject: [PATCH] Rmeove flakiness introduced by cleanup in configuration test (#37375) The changes in #37320 introduced flakiness while removing side-effect of configuration test. Cleanup of ProvidersManager might interfere with other tests using it at the same time. This caused some Non-DB test failures with missing keys in ProvidersManager. The fix is to mark the configuration test as DB-test - then it will never be run by NonDB xdist and it will always run sequentially to other tests (and still it will not introduce side-effect as cleanup will always be done between tests. (cherry picked from commit cbc9af09dd24d03ff849f116ffbe7bf231e48712) --- tests/core/test_configuration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/core/test_configuration.py b/tests/core/test_configuration.py index 0c8af1baabfee..595862c91a706 100644 --- a/tests/core/test_configuration.py +++ b/tests/core/test_configuration.py @@ -1654,6 +1654,9 @@ def test_error_when_contributing_to_existing_section(): assert conf.get("celery", "celery_app_name") == "test" +# Technically it's not a DB test, but we want to make sure it's not interfering with xdist non-db tests +# Because the `_cleanup` method might cause side-effect for parallel-run tests +@pytest.mark.db_test class TestWriteDefaultAirflowConfigurationIfNeeded: @pytest.fixture(autouse=True) def setup_test_cases(self, tmp_path_factory):