Last active
August 29, 2015 14:13
-
-
Save dkowis/3b5af9fa6bafdd7aa962 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.spockframework.runtime.SpockAssertionError | |
import spock.lang.Specification | |
import spock.util.concurrent.PollingConditions | |
class TimeoutExceptionProof extends Specification { | |
final def pollingConditions = new PollingConditions(timeout: 10, initialDelay: 1) | |
def "why does it fail"() { | |
when: | |
def foo = "bar" | |
then: | |
def loopCount = 0 | |
try { | |
pollingConditions.eventually { | |
loopCount += 1 | |
Thread.sleep(2500) | |
assert false == true | |
} | |
} catch (IllegalArgumentException iae) { | |
throw new SpockAssertionError("Illegal Arg exception: loop count $loopCount", iae) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Noting that the longer that delay within the eventually is, the sooner in the loop count it's going to tank.