Skip to content

Commit 3aece11

Browse files
committed
Fixed test_cwe
1 parent 2b6c6d2 commit 3aece11

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/test_anyio/test_cwe_404.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ async def pipe(
6666
writer: ByteSendStream,
6767
set_event_on_receive: bool,
6868
):
69-
while True:
70-
try:
71-
data = await reader.receive(1000)
72-
except anyio.EndOfStream:
73-
break
74-
# print(f"{name} read {len(data)} delay {self.delay}")
69+
async for data in reader:
7570
if set_event_on_receive:
7671
self.send_event.set()
7772

@@ -212,7 +207,6 @@ def set_delay(delay: float):
212207
async with RedisCluster.from_url(
213208
f"redis://{hostname}:{remap_base}", address_remap=remap
214209
) as r:
215-
await r.initialize()
216210
await r.set("foo", "foo")
217211
await r.set("bar", "bar")
218212

@@ -223,6 +217,7 @@ async def op(r):
223217
all_clear()
224218
async with anyio.create_task_group() as tg:
225219
# Wait for whichever DelayProxy gets the request first
220+
tg.start_soon(op, r)
226221
await wait_for_send()
227222
await anyio.sleep(0.01)
228223
tg.cancel_scope.cancel()

0 commit comments

Comments
 (0)