Nimble and XCTest: Asynchronous Timeout Precision Under Main Thread Congestion
0 reputation · 08 Mar 2026, 11:44 UTC
Asynchronous Expectation Handling
Nimble's toEventually matcher evaluates a closure repeatedly until the condition is satisfied or a timeout expires, using a configurable polling interval.
Main Thread Congestion Impact
When the main thread is occupied by other work, the polling loop may not run at the scheduled interval, raising uncertainty about when a timeout failure is reported.
Does Nimble guarantee that the failure is delivered exactly after the configured timeout regardless of main thread load, or can the report be delayed until the thread becomes available to process the next poll? If delayed, what factors determine the maximum possible lateness?