Skip to content

Commit 624f8c7

Browse files
authored
Merge pull request #877 from jd/fix-aiohttp-test-race
[aiohttp] Fix race condition in testing
2 parents 571d77e + 3ea963c commit 624f8c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/contrib/aiohttp/test_request_safety.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@ def make_requests():
6868
ctx = self.tracer.get_call_context()
6969
threads = [threading.Thread(target=make_requests) for _ in range(10)]
7070
for t in threads:
71-
t.daemon = True
7271
t.start()
7372

74-
# we should yield so that this loop can handle
75-
# threads' requests
76-
yield from asyncio.sleep(0.5)
7773
for t in threads:
78-
t.join(timeout=0.5)
74+
# we should yield so that this loop can handle
75+
# threads' requests
76+
yield from asyncio.sleep(0.1)
77+
t.join(0.1)
7978

8079
# the trace is wrong but the Context is finished
8180
traces = self.tracer.writer.pop_traces()

0 commit comments

Comments
 (0)