From 82081c1f7d60b7c18b0385608d76de0667f36a10 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 4 Apr 2013 14:51:25 +0100 Subject: [PATCH] MDL-38912 prevent time-outs during unit tests. --- lib/phpunit/classes/util.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 3e88015a96a..dbe1980c53b 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -139,6 +139,14 @@ class phpunit_util extends testing_util { if ($COURSE->id != $oldsite->id) { $warnings[] = 'Warning: unexpected change of $COURSE'; } + + if (ini_get('max_execution_time') != 0) { + // TODO un-comment this warning, once we have fixed the test + // failures that it causes. + // $warnings[] = 'Warning: max_execution_time was changed.'; + // See MDL-38989 for details. + set_time_limit(0); + } } // restore original globals