Skip to content

Commit 5966a61

Browse files
committed
Fix merge conflict: adopt main branch concurrency test approach with sync resource function
1 parent 242fea8 commit 5966a61

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/issues/test_188_concurrency.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ async def sleep_tool():
2424
return "done"
2525

2626
@server.resource(_resource_name)
27-
async def slow_resource():
27+
def slow_resource():
2828
call_timestamps.append(("resource_start_time", anyio.current_time()))
29-
await anyio.sleep(_sleep_time_seconds)
29+
# For sync function, we can't use anyio.sleep, so we'll use time.sleep
30+
import time
31+
32+
time.sleep(_sleep_time_seconds)
3033
call_timestamps.append(("resource_end_time", anyio.current_time()))
3134
return "slow"
3235

0 commit comments

Comments
 (0)