mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-66979 behat: Set script timeout with timeout factor
This commit is contained in:
parent
ec9bb74405
commit
e631b8c5e1
1 changed files with 14 additions and 1 deletions
|
@ -290,13 +290,26 @@ EOF;
|
||||||
if ($session->isStarted()) {
|
if ($session->isStarted()) {
|
||||||
$session->restart();
|
$session->restart();
|
||||||
} else {
|
} else {
|
||||||
$session->start();
|
$this->start_session();
|
||||||
}
|
}
|
||||||
if ($this->running_javascript() && $this->getSession()->getDriver()->getWebDriverSessionId() === 'session') {
|
if ($this->running_javascript() && $this->getSession()->getDriver()->getWebDriverSessionId() === 'session') {
|
||||||
throw new DriverException('Unable to create a valid session');
|
throw new DriverException('Unable to create a valid session');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start the Session, applying any initial configuratino required.
|
||||||
|
*/
|
||||||
|
protected function start_session(): void {
|
||||||
|
$this->getSession()->start();
|
||||||
|
|
||||||
|
$this->getSession()->getDriver()->setTimeouts([
|
||||||
|
// The standard script timeout is 30000 ms.
|
||||||
|
// Use `get_real_timeout` to multiply this by the behat increased timeout factor.
|
||||||
|
'script' => self::get_real_timeout(30000),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restart the session before each non-javascript scenario.
|
* Restart the session before each non-javascript scenario.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue