Skip to content

Commit

Permalink
Mark WASB blob tests as DB tests (#38963)
Browse files Browse the repository at this point in the history
The WASB blob tests started to fail intermittently after retries were
implemented in #38910. Without understanding all the details, it
seems that the async tests run in xdist mode of tests suffer from the
bug of pytest-xdist - because the thread that runs some of the tests
is not main and it likely interferes with signals handling and is
likely an incarnation of
pytest-dev/pytest-xdist#620
(which still needs to be solved in pytest-xdist)

Since those two tests that keeps on failing intermittently and the other
tests have been marked as db_test - likely for the same reason, we
should simply mark all the module as db_test to avoid the interference.
  • Loading branch information
potiuk authored Apr 12, 2024
1 parent c4a106e commit 8507ad9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/providers/microsoft/azure/triggers/test_wasb.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
TEST_WASB_CONN_ID = "wasb_default"
POKE_INTERVAL = 5.0

pytestmark = pytest.mark.db_test


class TestWasbBlobSensorTrigger:
TRIGGER = WasbBlobSensorTrigger(
Expand Down Expand Up @@ -78,7 +80,6 @@ async def test_running(self, mock_check_for_blob, blob_exists):
assert task.done() is False
asyncio.get_event_loop().stop()

@pytest.mark.db_test
@pytest.mark.asyncio
@mock.patch("airflow.providers.microsoft.azure.hooks.wasb.WasbAsyncHook.check_for_blob_async")
async def test_success(self, mock_check_for_blob):
Expand Down Expand Up @@ -115,7 +116,6 @@ async def test_waiting_for_blob(self, mock_check_for_blob, caplog):
assert message in caplog.text
asyncio.get_event_loop().stop()

@pytest.mark.db_test
@pytest.mark.asyncio
@mock.patch("airflow.providers.microsoft.azure.hooks.wasb.WasbAsyncHook.check_for_blob_async")
async def test_trigger_exception(self, mock_check_for_blob):
Expand Down Expand Up @@ -170,7 +170,6 @@ async def test_running(self, mock_check_for_prefix, prefix_exists):
assert task.done() is False
asyncio.get_event_loop().stop()

@pytest.mark.db_test
@pytest.mark.asyncio
@mock.patch("airflow.providers.microsoft.azure.hooks.wasb.WasbAsyncHook.check_for_prefix_async")
async def test_success(self, mock_check_for_prefix):
Expand Down Expand Up @@ -208,7 +207,6 @@ async def test_waiting_for_blob(self, mock_check_for_prefix):
mock_log_info.assert_called_once_with(message)
asyncio.get_event_loop().stop()

@pytest.mark.db_test
@pytest.mark.asyncio
@mock.patch("airflow.providers.microsoft.azure.hooks.wasb.WasbAsyncHook.check_for_prefix_async")
async def test_trigger_exception(self, mock_check_for_prefix):
Expand Down

0 comments on commit 8507ad9

Please sign in to comment.