private function FeatureContext::spin in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 behat-tests/features/bootstrap/FeatureContext.php \FeatureContext::spin()
Keep retrying assertion for a defined number of iterations.
Parameters
closure $lambda Callback.:
integer $attemptThreshold Number of attempts to execute the command.:
Return value
mixed
Throws
\Exception If attemptThreshold is met.
1 call to FeatureContext::spin()
- FeatureContext::spinJavaScriptEvaluation in behat-tests/features/ bootstrap/ FeatureContext.php 
- Spin JavaScript evaluation.
File
- behat-tests/features/ bootstrap/ FeatureContext.php, line 791 
Class
- FeatureContext
- Defines application features from the specific context.
Code
private function spin($lambda, $attemptThreshold = 15) {
  for ($iteration = 0; $iteration <= $attemptThreshold; $iteration++) {
    try {
      if (call_user_func($lambda)) {
        return;
      }
    } catch (\Exception $exception) {
      // do nothing
    }
    sleep(1);
  }
}