Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions providers/standard/tests/unit/standard/triggers/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ async def test_task_file_trigger(self, tmp_path):

p.touch()

await asyncio.sleep(0.5)
# Await the task directly so the assertion can't race the trigger's
# detect → yield cycle on slow runners (ARM, Pendulum2 special job).
await asyncio.wait_for(task, timeout=5.0)
assert task.done() is True

# Prevents error when task is destroyed while in "pending" state
asyncio.get_event_loop().stop()


@pytest.mark.skipif(not AIRFLOW_V_3_0_PLUS, reason="Skip on Airflow < 3.0")
class TestFileDeleteTrigger:
Expand Down Expand Up @@ -101,8 +100,9 @@ async def test_file_delete_trigger(self, tmp_path):

p.touch()

await asyncio.sleep(0.5)
# Await the task directly so the assertion can't race the trigger's
# detect → unlink → yield cycle on slow runners (ARM, Pendulum2
# special job). The trigger only yields after `await filepath.unlink()`
# returns, so once the task is done, the file is guaranteed gone.
await asyncio.wait_for(task, timeout=5.0)
assert await anyio.Path(p).exists() is False

# Prevents error when task is destroyed while in "pending" state
asyncio.get_event_loop().stop()
Loading