mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
Merge branch 'wip-mdl-57940' of https://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
c742c61956
@ -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.
|
||||
|
@ -493,9 +493,10 @@ function behat_get_run_process() {
|
||||
*
|
||||
* @param array $cmds list of commands to be executed.
|
||||
* @param string $cwd absolute path of working directory.
|
||||
* @param int $delay time in seconds to add delay between each parallel process.
|
||||
* @return array list of processes.
|
||||
*/
|
||||
function cli_execute_parallel($cmds, $cwd = null) {
|
||||
function cli_execute_parallel($cmds, $cwd = null, $delay = 0) {
|
||||
require_once(__DIR__ . "/../../vendor/autoload.php");
|
||||
|
||||
$processes = array();
|
||||
@ -519,6 +520,11 @@ function cli_execute_parallel($cmds, $cwd = null) {
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Sleep for specified delay.
|
||||
if ($delay) {
|
||||
sleep($delay);
|
||||
}
|
||||
}
|
||||
return $processes;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user