Title: [142324] trunk/LayoutTests
Revision
142324
Author
jsb...@chromium.org
Date
2013-02-08 14:48:46 -0800 (Fri, 08 Feb 2013)

Log Message

IndexedDB: De-flake open-during-transaction layout test
https://bugs.webkit.org/show_bug.cgi?id=109072

Reviewed by Tony Chang.

This test was observed to be flaky in local runs; sometimes the transaction
would terminate after the third open() call rather than the second, resulting
in a TEXT difference. Added code to keep the transaction alive until all of
the open() calls are complete, and changed expectations to match.

* storage/indexeddb/open-during-transaction-expected.txt:
* storage/indexeddb/resources/open-during-transaction.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (142323 => 142324)


--- trunk/LayoutTests/ChangeLog	2013-02-08 22:35:28 UTC (rev 142323)
+++ trunk/LayoutTests/ChangeLog	2013-02-08 22:48:46 UTC (rev 142324)
@@ -1,3 +1,18 @@
+2013-02-08  Joshua Bell  <jsb...@chromium.org>
+
+        IndexedDB: De-flake open-during-transaction layout test
+        https://bugs.webkit.org/show_bug.cgi?id=109072
+
+        Reviewed by Tony Chang.
+
+        This test was observed to be flaky in local runs; sometimes the transaction
+        would terminate after the third open() call rather than the second, resulting
+        in a TEXT difference. Added code to keep the transaction alive until all of
+        the open() calls are complete, and changed expectations to match.
+
+        * storage/indexeddb/open-during-transaction-expected.txt:
+        * storage/indexeddb/resources/open-during-transaction.js:
+
 2013-02-08  Stephen Chenney  <schen...@chromium.org>
 
         [Chromium] Expectations as a result of removing Skia code suppressions

Modified: trunk/LayoutTests/storage/indexeddb/open-during-transaction-expected.txt (142323 => 142324)


--- trunk/LayoutTests/storage/indexeddb/open-during-transaction-expected.txt	2013-02-08 22:35:28 UTC (rev 142323)
+++ trunk/LayoutTests/storage/indexeddb/open-during-transaction-expected.txt	2013-02-08 22:48:46 UTC (rev 142324)
@@ -14,7 +14,7 @@
 starting transaction
 state = 'starting'
 trans = dbc1.transaction('storeName', 'readwrite')
-trans.objectStore('storeName').put('value', 'key')
+the transaction is kept alive with a series of puts until opens are complete
 
 trying to open the same database
 openreq2 = indexedDB.open(dbname)
@@ -26,12 +26,13 @@
 PASS state is "starting"
 state = 'open2complete'
 
-transaction complete
-PASS state is "open2complete"
-
 openreq3.onsuccess
 PASS state is "open2complete"
 state = 'open3complete'
+
+transaction complete
+PASS state is "open3complete"
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/resources/open-during-transaction.js (142323 => 142324)


--- trunk/LayoutTests/storage/indexeddb/resources/open-during-transaction.js	2013-02-08 22:35:28 UTC (rev 142323)
+++ trunk/LayoutTests/storage/indexeddb/resources/open-during-transaction.js	2013-02-08 22:48:46 UTC (rev 142324)
@@ -21,13 +21,24 @@
     debug("starting transaction");
     evalAndLog("state = 'starting'");
     evalAndLog("trans = dbc1.transaction('storeName', 'readwrite')");
-    evalAndLog("trans.objectStore('storeName').put('value', 'key')");
+
+    debug("the transaction is kept alive with a series of puts until opens are complete");
+    (function keepAlive() {
+        // Don't log, since this may run an arbitrary number of times.
+        if (state !== 'open3complete') {
+            var request = trans.objectStore('storeName').put('value', 'key');
+            request._onerror_ = unexpectedErrorCallback;
+            request._onsuccess_ = keepAlive;
+        }
+    }());
+
     trans._onabort_ = unexpectedAbortCallback;
     trans._onerror_ = unexpectedErrorCallback;
     trans._oncomplete_ = function (e) {
         debug("transaction complete");
-        shouldBeEqualToString("state", "open2complete");
+        shouldBeEqualToString("state", "open3complete");
         debug("");
+        finishJSTest();
     };
 
     debug("");
@@ -44,7 +55,7 @@
         shouldBeEqualToString("state", "starting");
         evalAndLog("state = 'open2complete'");
         debug("");
-    }
+    };
     debug("");
 
     debug("trying to open a different database");
@@ -54,7 +65,7 @@
         debug("openreq3.onsuccess");
         shouldBeEqualToString("state", "open2complete");
         evalAndLog("state = 'open3complete'");
-        finishJSTest();
-    }
+        debug("");
+    };
     debug("");
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to