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
If you have an async function it is currently not possible to test it utilising the XCTest Measure library. Even if you have no awaits as part of the async function, if the function signature is async and needs to be awaited it does not work.
Suggestion: Run the method as part of main actor, starting the measuring of what I will call block() right before execution and ending right after execution.
Assuming no other tasks are spun up inside the function being called, would this ensure that the task is run synchronously and thus performance tested? Or is there other alternatives.
The text was updated successfully, but these errors were encountered:
ali-ahsan-ali
changed the title
Async Performance Testing
Async/Await support in Performance Testing methods
Apr 29, 2024
If you have an async function it is currently not possible to test it utilising the XCTest Measure library. Even if you have no awaits as part of the async function, if the function signature is async and needs to be awaited it does not work.
Suggestion: Run the method as part of main actor, starting the measuring of what I will call
block()
right before execution and ending right after execution.Assuming no other tasks are spun up inside the function being called, would this ensure that the task is run synchronously and thus performance tested? Or is there other alternatives.
The text was updated successfully, but these errors were encountered: