Skip to content

Commit 7203165

Browse files
committed
FIX: Fix flakiness in MacOS GitHub runners
1 parent e34d45a commit 7203165

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_live_client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Unit tests for the Live client."""
22
import asyncio
33
import pathlib
4+
import platform
45
from io import BytesIO
56
from typing import Callable
67
from unittest.mock import MagicMock
@@ -370,9 +371,10 @@ def test_live_stop(
370371
schema=Schema.MBO,
371372
)
372373

373-
live_client.start()
374374
assert live_client.is_connected() is True
375375

376+
live_client.start()
377+
376378
live_client.stop()
377379
live_client.block_for_close()
378380

@@ -431,7 +433,6 @@ def test_live_block_for_close_timeout(
431433
symbols="*",
432434
start=None,
433435
)
434-
live_client.start()
435436
live_client.block_for_close(timeout=0)
436437
live_client.terminate.assert_called_once() # type: ignore
437438

@@ -557,6 +558,7 @@ def test_live_add_stream_invalid(
557558

558559

559560
@pytest.mark.asyncio
561+
@pytest.mark.skipif(platform.system() == "Darwin", reason="flaky on MacOS runner")
560562
async def test_live_async_iteration(
561563
live_client: client.Live,
562564
) -> None:
@@ -583,6 +585,7 @@ async def test_live_async_iteration(
583585

584586

585587
@pytest.mark.asyncio
588+
@pytest.mark.skipif(platform.system() == "Darwin", reason="flaky on MacOS runner")
586589
async def test_live_async_iteration_backpressure(
587590
live_client: client.Live,
588591
monkeypatch: pytest.MonkeyPatch,
@@ -628,6 +631,7 @@ async def test_live_async_iteration_backpressure(
628631

629632

630633
@pytest.mark.asyncio
634+
@pytest.mark.skipif(platform.system() == "Darwin", reason="flaky on MacOS runner")
631635
async def test_live_async_iteration_dropped(
632636
live_client: client.Live,
633637
monkeypatch: pytest.MonkeyPatch,
@@ -670,6 +674,7 @@ async def test_live_async_iteration_dropped(
670674

671675

672676
@pytest.mark.asyncio
677+
@pytest.mark.skipif(platform.system() == "Darwin", reason="flaky on MacOS runner")
673678
async def test_live_async_iteration_stop(
674679
live_client: client.Live,
675680
) -> None:
@@ -697,6 +702,7 @@ async def test_live_async_iteration_stop(
697702
assert isinstance(records[2], databento_dbn.MBOMsg)
698703

699704

705+
@pytest.mark.skipif(platform.system() == "Darwin", reason="flaky on MacOS runner")
700706
def test_live_sync_iteration(
701707
live_client: client.Live,
702708
) -> None:

0 commit comments

Comments
 (0)