Bug 743490 - Frequent test_redirects.js | test failed.
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 12 Apr 2012 10:37:54 +0200
changeset 91503 71539685fa1af07cf7261d02da0df5f9afd01eaa
parent 91502 987f9a47cee9655bb0eb0d14e050cd95b2db208d
child 91504 901dfde601838438440841311929e608fba7960e
child 91526 bfa9350d9ed9de7a0f4c5c1580a57ab860e71959
push id22445
push usereakhgari@mozilla.com
push dateThu, 12 Apr 2012 16:19:55 +0000
treeherdermozilla-central@901dfde60183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs743490
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743490 - Frequent test_redirects.js | test failed. r=dietrich
toolkit/components/places/tests/queries/head_queries.js
--- a/toolkit/components/places/tests/queries/head_queries.js
+++ b/toolkit/components/places/tests/queries/head_queries.js
@@ -107,24 +107,27 @@ function populateDB(aArray) {
             }
           }
 
           if (qdata.isRedirect) {
             // Redirect sources added through the docshell are properly marked
             // as redirects and get hidden state, the API doesn't have that
             // power (And actually doesn't make much sense to add redirects
             // through the API).
-            let stmt = DBConn().createStatement(
+            // This must be async cause otherwise the updateFrecency call
+            // done by addVisits may randomly happen after it, overwriting the
+            // value.
+            let stmt = DBConn().createAsyncStatement(
               "UPDATE moz_places SET hidden = 1 WHERE url = :url");
             stmt.params.url = qdata.uri;
             try {
-              stmt.execute();
+              stmt.executeAsync();
             }
             catch (ex) {
-              print("Error while setting visit_count.");
+              print("Error while setting hidden.");
             }
             finally {
               stmt.finalize();
             }
           }
 
           if (qdata.isDetails) {
             // Then we add extraneous page details for testing