From 1dfe4d8691ac4358dfd4791769df6ef760c3ba99 Mon Sep 17 00:00:00 2001
From: drugan <drugan@1578644.no-reply.drupal.org>
Date: Fri, 3 Mar 2017 21:57:08 +0200
Subject: [PATCH] Issue #2745123 by drugan, mondrake, Mile23, benjifisher,
 penyaskito, hgoto, othermachines, Jaypan, alexpott:
 Simpletest module crashes on cleanup, uninstall

---
 core/modules/simpletest/simpletest.module |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index c9eed3b..79e2fd6 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -692,7 +692,9 @@ function simpletest_clean_temporary_directories() {
     foreach ($files as $file) {
       if ($file[0] != '.') {
         $path = DRUPAL_ROOT . '/sites/simpletest/' . $file;
-        file_unmanaged_delete_recursive($path, array('Drupal\simpletest\TestBase', 'filePreDeleteCallback'));
+        file_unmanaged_delete_recursive($path, function ($any_path) {
+          @chmod($any_path, 0700);
+        });
         $count++;
       }
     }
-- 
1.7.9.5

