Commit 4559088c authored by catch's avatar catch

Issue #3040166 by willzyx, Mile23, alexpott, cilefen: mkdir() fails in...

Issue #3040166 by willzyx, Mile23, alexpott, cilefen: mkdir() fails in BrowserHtmlDebugTrait.php:141 because of a race condition

(cherry picked from commit c080fb87)
parent da0a2367
...@@ -137,8 +137,8 @@ protected function initBrowserOutputFile() { ...@@ -137,8 +137,8 @@ protected function initBrowserOutputFile() {
$this->htmlOutputDirectory = DRUPAL_ROOT . '/sites/simpletest/browser_output'; $this->htmlOutputDirectory = DRUPAL_ROOT . '/sites/simpletest/browser_output';
// Do not use the file_system service so this method can be called before // Do not use the file_system service so this method can be called before
// it is available. // it is available.
if (!is_dir($this->htmlOutputDirectory)) { if (!is_dir($this->htmlOutputDirectory) && !mkdir($this->htmlOutputDirectory, 0775, TRUE) && !is_dir($this->htmlOutputDirectory)) {
mkdir($this->htmlOutputDirectory, 0775, TRUE); throw new \RuntimeException(sprintf('Unable to create directory: %s', $this->htmlOutputDirectory));
} }
if (!file_exists($this->htmlOutputDirectory . '/.htaccess')) { if (!file_exists($this->htmlOutputDirectory . '/.htaccess')) {
file_put_contents($this->htmlOutputDirectory . '/.htaccess', "<IfModule mod_expires.c>\nExpiresActive Off\n</IfModule>\n"); file_put_contents($this->htmlOutputDirectory . '/.htaccess', "<IfModule mod_expires.c>\nExpiresActive Off\n</IfModule>\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment