Skip to content

Commit 5904968

Browse files
committed
ref(test): Remove flush from async transport test
Flush in async only flushes the worker, but does not cancel the task. This leads to errors, as the end of the test closes the event loop, but the worker task is still running. GH-4601
1 parent c80b095 commit 5904968

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

tests/test_transport.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,10 @@ def test_transport_works(
149149

150150
@pytest.mark.asyncio
151151
@pytest.mark.parametrize("debug", (True, False))
152-
@pytest.mark.parametrize("client_flush_method", ["close", "flush"])
152+
@pytest.mark.parametrize("client_flush_method", ["close"])
153153
@pytest.mark.parametrize("use_pickle", (True, False))
154154
@pytest.mark.parametrize("compression_level", (0, 9, None))
155155
@pytest.mark.parametrize("compression_algo", ("gzip", "br", "<invalid>", None))
156-
@pytest.mark.parametrize("http2", [True, False] if PY38 else [False])
157156
async def test_transport_works_async(
158157
capturing_server,
159158
request,
@@ -165,7 +164,6 @@ async def test_transport_works_async(
165164
use_pickle,
166165
compression_level,
167166
compression_algo,
168-
http2,
169167
):
170168
caplog.set_level(logging.DEBUG)
171169

@@ -176,9 +174,6 @@ async def test_transport_works_async(
176174
if compression_algo is not None:
177175
experiments["transport_compression_algo"] = compression_algo
178176

179-
if http2:
180-
experiments["transport_http2"] = True
181-
182177
# Enable async transport
183178
experiments["transport_async"] = True
184179

@@ -205,11 +200,6 @@ async def test_transport_works_async(
205200

206201
if client_flush_method == "close":
207202
await client.close(timeout=2.0)
208-
else:
209-
if hasattr(client, "_flush_async"):
210-
await client._flush_async(timeout=2.0, callback=None)
211-
# Need to kill, as the end of the test will close the event loop, but the worker task is still alive
212-
client.transport._worker.kill()
213203

214204
out, err = capsys.readouterr()
215205
assert not err and not out

0 commit comments

Comments
 (0)