MDL-57940 behat: Allow behat parallel run to start with delay

Behat parallel run if executed together
then selenium might fail to launch browser
and timeout. It would be nice to have a
custom delay between the start of each process
This commit is contained in:
Rajesh Taneja
2017-02-27 16:15:31 +08:00
parent 0f59b6dd75
commit 26bf6d4ead
2 changed files with 13 additions and 2 deletions
+6 -1
View File
@@ -262,8 +262,13 @@ if (empty($parallelrun)) {
behat_config_manager::set_behat_run_config_value('lasttorun', $options['torun']);
behat_config_manager::set_behat_run_config_value('lastfromrun', $options['fromrun']);
// Keep no delay by default, between each parallel, let user decide.
if (!defined('BEHAT_PARALLEL_START_DELAY')) {
define('BEHAT_PARALLEL_START_DELAY', 0);
}
// Execute all commands, relative to moodle root directory.
$processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../");
$processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../", BEHAT_PARALLEL_START_DELAY);
$stoponfail = empty($options['stop-on-failure']) ? false : true;
// Print header.