kif-framework/KIF — pull request #351 by pavolas (2014-03-22 01:11:21+00:00)
Title: Prevent KIF steps from unnecessarily waiting too long.

If a KIF step's execution block synchronously succeeded, the previous code was stuck running the CFRunLoop for 0.1 seconds! This significantly increases the run-time of all tests. :(

There are a couple common ways of running CFRunLoopRunInMode, one of which is to pass in '0' for the second parameter. This only runs the run loop once, which causes the executionBlock to execute many times in quick succession, if the step doesn't synchronously succeed. I choose the value 0.0001 pretty arbitrarily. It prevents steps from which synchronously succeed from spinning for too much extra time, but also prevents excessive calls to the executionBlock, which itself may take a non-trivial amount of time to execute.