Title: [221752] trunk/LayoutTests
Revision
221752
Author
[email protected]
Date
2017-09-07 13:12:57 -0700 (Thu, 07 Sep 2017)

Log Message

[Win] tests/security/contentSecurityPolicy/report-only.php is flaky.
https://bugs.webkit.org/show_bug.cgi?id=176541

Reviewed by Brent Fulgham.

The function call rename will sometimes fail on Windows because one of the files is
opened by another process. If rename fails, wait, and try again.

* http/tests/security/contentSecurityPolicy/resources/save-report.php:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (221751 => 221752)


--- trunk/LayoutTests/ChangeLog	2017-09-07 20:12:18 UTC (rev 221751)
+++ trunk/LayoutTests/ChangeLog	2017-09-07 20:12:57 UTC (rev 221752)
@@ -1,3 +1,15 @@
+2017-09-07  Per Arne Vollan  <[email protected]>
+
+        [Win] tests/security/contentSecurityPolicy/report-only.php is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=176541
+
+        Reviewed by Brent Fulgham.
+
+        The function call rename will sometimes fail on Windows because one of the files is
+        opened by another process. If rename fails, wait, and try again.
+
+        * http/tests/security/contentSecurityPolicy/resources/save-report.php:
+
 2017-09-07  Chris Dumez  <[email protected]>
 
         [WK2] Notify client when downloads are redirected

Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/save-report.php (221751 => 221752)


--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/save-report.php	2017-09-07 20:12:18 UTC (rev 221751)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/resources/save-report.php	2017-09-07 20:12:57 UTC (rev 221752)
@@ -21,8 +21,11 @@
 fwrite($reportFile, "=== POST DATA =""
 fwrite($reportFile, file_get_contents("php://input"));
 fclose($reportFile);
-rename($reportFilePath . ".tmp", $reportFilePath);
 
+// On Windows, rename will sometimes fail because one of the files is used by another process.
+while (!rename($reportFilePath . ".tmp", $reportFilePath))
+    sleep(1);
+
 if (!isset($DO_NOT_CLEAR_COOKIES) || !$DO_NOT_CLEAR_COOKIES) {
     foreach ($_COOKIE as $name => $value)
         setcookie($name, "deleted", time() - 60, "/");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to