Ancestors

Toot

Written by Robert Ryan on 2024-11-20 at 22:41

Why does the Swift Testing framework only support timeouts measured in minutes? When writing XCTestCase tests, I frequently use “expectations” measured in seconds, not minutes. If I’m unit testing something that slow, I’d generally mock the slow service with something that returned results in a reasonable timeframe. I don’t necessarily mind that they support “minutes”, but it seems odd to not support a much shorter timeout. What is the thought process here? https://developer.apple.com/documentation/testing/limitingexecutiontime

=> More informations about this toot | More toots from robertryan@mastodon.social

Descendants

Written by Matt Massicotte on 2024-11-20 at 22:59

@robertryan I think there’s some documentation that explains this in the docc content. But yeah it’s weird and you aren’t the first person to think so.

=> More informations about this toot | More toots from mattiem@mastodon.social

Written by Robert Ryan on 2024-11-20 at 23:03

@mattiem Yeah the headers say: “It is used instead of Swift's built-in Duration type because test timeouts do not support high-precision, arbitrarily short durations. The smallest allowed unit of time is minutes.” Sure, maybe not nanoseconds or attoseconds. But surely “seconds” doesn’t qualify as “high-precision”. Lol.

=> More informations about this toot | More toots from robertryan@mastodon.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113517691780091334
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
252.101433 milliseconds
Gemini-to-HTML Time
0.804396 milliseconds

This content has been proxied by September (3851b).