Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made a few updates to re-wire the timeout value from the command line…

… into the Job script generator
  • Loading branch information...
commit 89716eb8fa19803a694fcd9a095882a067cad809 1 parent ea560aa
Pádraic Brady authored
View
17 library/Mutagenesis/Adapter/Phpunit.php
@@ -72,9 +72,9 @@ public function runTests(\Mutagenesis\Runner\Base $runner, $useStdout = true,
$job->generate(
$mutation,
$args,
+ $runner->getTimeout(),
$runner->getBootstrap()
- ),
- $runner->getTimeout()
+ )
);
if (!$this->processOutput($output['stdout'])) {
return array(false, $output);
@@ -85,9 +85,14 @@ public function runTests(\Mutagenesis\Runner\Base $runner, $useStdout = true,
$job->generate(
$mutation,
$options,
+ /**
+ * We don't want the initial test run to time out because it
+ * executes all tests in a single process for PHPUnit (though
+ * PHPUnit may use parallel processes internally).
+ */
+ 0,
$runner->getBootstrap()
- ),
- $runner->getTimeout()
+ )
);
if (!$this->processOutput($output['stdout'])) {
return array(false, $output);
@@ -102,9 +107,9 @@ public function runTests(\Mutagenesis\Runner\Base $runner, $useStdout = true,
* @param string $jobScript
* @return string $output
*/
- public static function execute($jobScript, $timeout = 120)
+ public static function execute($jobScript)
{
- $output = \Mutagenesis\Utility\Process::run($jobScript, $timeout);
+ $output = \Mutagenesis\Utility\Process::run($jobScript);
return $output;
}
View
4 library/Mutagenesis/Runner/RunnerAbstract.php
@@ -133,11 +133,11 @@
protected $_options = array();
/**
- * Timeout in seconds allowed per test execution
+ * Timeout in seconds allowed per test execution.
*
* @var int
*/
- protected $_timeout = 120;
+ protected $_timeout = 60;
/**
* Test framework bootstrap
View
4 library/Mutagenesis/Utility/Job.php
@@ -30,7 +30,7 @@ class Job
* @param array $mutation Mutation data and objects to be used
* @return string
*/
- public function generate(array $mutation = array(), array $args = array(), $bootstrap = null)
+ public function generate(array $mutation = array(), array $args = array(), $timeout = 60, $bootstrap = null)
{
$serializedArgs = addslashes(serialize($args));
$serializedMutation = addslashes(serialize($mutation));
@@ -60,7 +60,7 @@ static function timeout() {
}
}
pcntl_signal(SIGALRM, array('\\MutagenesisEnv\\Job', 'timeout'), TRUE);
-pcntl_alarm(120);
+pcntl_alarm({$timeout});
try {
Job::main();
} catch (\\Exception \$e) {
View
2  tests/Mutagenesis/Utility/JobTest.php
@@ -49,7 +49,7 @@ static function timeout() {
}
}
pcntl_signal(SIGALRM, array('\\MutagenesisEnv\\Job', 'timeout'), TRUE);
-pcntl_alarm(120);
+pcntl_alarm(60);
try {
Job::main();
} catch (\\Exception \$e) {
Please sign in to comment.
Something went wrong with that request. Please try again.