MDL-32323 do lot try to acquire lock before dataroot init

This commit is contained in:
Petr Skoda 2012-04-07 19:27:49 +02:00
parent 4787e466d6
commit 6c583c75f9

View File

@ -72,6 +72,10 @@ class phpunit_util {
*/
public static function acquire_test_lock() {
global $CFG;
if (!file_exists("$CFG->phpunit_dataroot/phpunit")) {
// dataroot not initialised yet
return;
}
if (!file_exists("$CFG->phpunit_dataroot/phpunit/lock")) {
file_put_contents("$CFG->phpunit_dataroot/phpunit/lock", 'This file prevents concurrent execution of Moodle PHPUnit tests');
phpunit_boostrap_fix_file_permissions("$CFG->phpunit_dataroot/phpunit/lock");