[BUGFIX] Race condition in Unit / FunctionalTestBootstrap 71/39171/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 1 May 2015 18:42:38 +0000 (20:42 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 1 May 2015 20:10:28 +0000 (22:10 +0200)
Executing tests in parallel sometimes leads to race conditions
preparing the environment. This rare case is now just suppressed
and shut off.

Resolves: #66720
Releases: master
Change-Id: I63de8c8cf8460772d0896f1957701f053ca82590
Reviewed-on: http://review.typo3.org/39171
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/core/Build/FunctionalTestsBootstrap.php
typo3/sysext/core/Build/UnitTestsBootstrap.php

index 06f6fcb..4c06422 100644 (file)
@@ -100,8 +100,9 @@ class FunctionalTestsBootstrap {
                if (is_dir($directory)) {
                        return;
                }
-
-               if (!mkdir($directory, 0777, TRUE)) {
+               @mkdir($directory, 0777, TRUE);
+               clearstatcache();
+               if (!is_dir($directory)) {
                        throw new \RuntimeException('Directory "' . $directory . '" could not be created', 1404038665);
                }
        }
index b2bb7e2..7517732 100644 (file)
@@ -158,8 +158,9 @@ class UnitTestsBootstrap {
                if (is_dir($directory)) {
                        return;
                }
-
-               if (!mkdir($directory, 0777, TRUE)) {
+               @mkdir($directory, 0777, TRUE);
+               clearstatcache();
+               if (!is_dir($directory)) {
                        throw new \RuntimeException('Directory "' . $directory . '" could not be created', 1423043755);
                }
        }