Changeset 68870 in webkit


Ignore:
Timestamp:
Oct 1, 2010 12:52:36 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-10-01 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

http/tests/navigation/ping-same-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=46961

This test fails by forgetting to print out the REQUEST_METHOD:

http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r68727%20(18470)/http/tests/navigation/ping-same-origin-pretty-diff.html

The only way this makes sense is if the file isn't finished writing by
the time it gets read. This can happen because the reader is polling
the file for existence (!) to decide whether to read it.

This patch writes to a temporary location and then moves the finished
bytes into the well-known location atomically. I haven't verified that
it fixes the flakiness, but it seems like a good bet.

  • http/tests/navigation/resources/save-ping.php:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r68868 r68870  
     12010-10-01  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        http/tests/navigation/ping-same-origin.html is flaky
     6        https://bugs.webkit.org/show_bug.cgi?id=46961
     7
     8        This test fails by forgetting to print out the REQUEST_METHOD:
     9
     10        http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r68727%20(18470)/http/tests/navigation/ping-same-origin-pretty-diff.html
     11
     12        The only way this makes sense is if the file isn't finished writing by
     13        the time it gets read.  This can happen because the reader is polling
     14        the file for existence (!) to decide whether to read it.
     15
     16        This patch writes to a temporary location and then moves the finished
     17        bytes into the well-known location atomically.  I haven't verified that
     18        it fixes the flakiness, but it seems like a good bet.
     19
     20        * http/tests/navigation/resources/save-ping.php:
     21
    1222010-10-01  Vincent Scheib  <scheib@chromium.org>
    223
  • trunk/LayoutTests/http/tests/navigation/resources/save-ping.php

    r68166 r68870  
    11<?php
    2 $pingFile = fopen("ping.txt", 'w');
     2$pingFile = fopen("ping.txt.tmp", 'w');
    33$httpHeaders = $_SERVER;
    44ksort($httpHeaders, SORT_STRING);
     
    88}
    99fclose($pingFile);
     10rename("ping.txt.tmp", "ping.txt");
    1011?>
Note: See TracChangeset for help on using the changeset viewer.