Skip to content

Commit

Permalink
fix flaky test_unretrieved_future_exception_server_crash
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jan 2, 2025
1 parent 2a105b2 commit ef17343
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def _identity(v: _T) -> _T:
)


@pytest.fixture
def gc_collect() -> None:
gc.collect()


@_ignore_win32_resource_warnings
class TestTCPStream:
@pytest.fixture
Expand Down Expand Up @@ -490,7 +495,7 @@ def serve() -> None:

@pytest.mark.parametrize("anyio_backend", ["asyncio"])
async def test_unretrieved_future_exception_server_crash(
self, family: AnyIPAddressFamily, caplog: LogCaptureFixture
self, family: AnyIPAddressFamily, caplog: LogCaptureFixture, gc_collect: None
) -> None:
"""
Test that there won't be any leftover Futures that don't get their exceptions
Expand Down

0 comments on commit ef17343

Please sign in to comment.