Unit tests MDL-24909 Unit tests used 5 minute time limit per test class; this is insufficient for gradebook tests on slow server. Changed to use 60 second limit per test function instead. Added constant and comment defining this behaviour.
This commit is contained in:
@@ -138,6 +138,11 @@ class SimpleTestCase {
|
||||
$reporter->paintCaseStart($this->getLabel());
|
||||
$started = true;
|
||||
}
|
||||
//moodlefix begins
|
||||
if (defined('TIME_ALLOWED_PER_UNIT_TEST')) {
|
||||
set_time_limit(TIME_ALLOWED_PER_UNIT_TEST);
|
||||
}
|
||||
//moodlefix ends
|
||||
$invoker = &$this->_reporter->createInvoker($this->createInvoker());
|
||||
$invoker->before($method);
|
||||
$invoker->invoke($method);
|
||||
@@ -607,9 +612,6 @@ class TestSuite {
|
||||
$reporter->paintSkip("Unit test \"{$class}\" of type UnitTestCaseUsingDatabase skipped. Must define different, non-conflicting \$CFG->unittestprefix to be runnable.");
|
||||
continue;
|
||||
}
|
||||
if ($currenttl = @ini_get('max_execution_time')) {
|
||||
@ini_set('max_execution_time', $currenttl);
|
||||
}
|
||||
// moodle hack end
|
||||
$test = new $class();
|
||||
$test->run($reporter);
|
||||
|
||||
Reference in New Issue
Block a user