You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems yappi gets confused when a coroutine is scheduled as a task and awaited from the same function and the task returns first. If the task returns first the timings from the explicit await on the coroutine get lost (still contributes to the call count):
fromasyncioimportcreate_task, run, sleepimportyappiyappi.set_clock_type('wall')
asyncdeftest(d=0):
t=create_task(sleep(5+d))
awaitsleep(5)
awaittfordin [-2, 0, 2]:
withyappi.run():
run(test(d))
print(f'#### d={d} (expect tsub ~ ttot ~ 2*5+d={2*5+d}):') # but we get 5-d if d < 0yappi.get_func_stats(filter_callback=lambdax: yappi.func_matches(x, [sleep])).print_all()
yappi.clear_stats()
The text was updated successfully, but these errors were encountered:
It seems
yappi
gets confused when a coroutine is scheduled as a task and awaited from the same function and the task returns first. If the task returns first the timings from the explicit await on the coroutine get lost (still contributes to the call count):The text was updated successfully, but these errors were encountered: