Skip to content

Commit

Permalink
MDL-70734 behat: Increase the WebDriver Curl timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 31, 2021
1 parent 9dabd07 commit 793f131
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/behat/classes/behat_session_trait.php
Expand Up @@ -1369,11 +1369,9 @@ public function set_test_timeout_factor(int $factor = 1): void {
return;
}

// Use `get_real_timeout` to multiply the timeout by the global behat_increasetimeout value, and again by the
// factor specified.
$this->getSession()->getDriver()->setTimeouts([
// The standard script timeout is 30000 ms. (aka, 30 seconds).
'script' => self::get_real_timeout(30) * 1000 * $factor,
]);
// The standard curl timeout is 30 seconds.
// Use get_real_timeout and multiply by the timeout factor to get the final timeout.
$timeout = self::get_real_timeout(30) * 1000 * $factor;
$driver->getWebDriver()->getCommandExecutor()->setRequestTimeout($timeout);
}
}

0 comments on commit 793f131

Please sign in to comment.