Closed Bug 504466 Opened 15 years ago Closed 14 years ago

xpcshell-tests: random failure of test_utils_getURLsForContainerNode.js

Categories

(Firefox :: Bookmarks & History, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Unassigned)

References

Details

(Keywords: intermittent-failure, Whiteboard: [workarounded by bug521225 on trunk])

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox-Unittest/1247697473.1247699090.14075.gz
Linux mozilla-central test everythingelse on 2009/07/15 15:37:53  

just had the random failure:

TEST-UNEXPECTED-FAIL | /builds/moz2_slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | test failed (with xpcshell return code: 0), see following log:
TEST-UNEXPECTED-FAIL | /builds/moz2_slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | false == true - See following stack:
Unknown Error: command finished with exit code: 1
Whiteboard: [orange]
can be due to the fact actually (after bug 483980) all our unit tests run with DBFlush service enabled, so temp/disk tables status could cause failures previously undetected.
i'm investigating this, it is really strange, in some situation we get some result duplicated, looks really like a partitioning issue but still have to find how we fall into such a situation.
Assignee: nobody → mak77
so, running the test in loops clearly shows the error, practically sometimes a bookmark is returned twice by the method.
When this happens the executed query is mDBGetChildren, and it is effectively returning the bookmark twice.

to read it better i rewrote the query like this:

      "SELECT null, null, b.title, "
        "null, null, null, null, null, b.id, "
        "b.dateAdded, b.lastModified, b.position, b.type, b.fk, b.folder_type "
      "FROM moz_bookmarks b "
      "WHERE b.parent = ?1 AND b.fk ISNULL "
      "UNION ALL "
      "SELECT h.id, h.url, COALESCE(b.title, h.title), "
        "h.rev_host, h.visit_count, h.last_visit_date, f.url, null, b.id, "
        "b.dateAdded, b.lastModified, b.position, b.type, b.fk, b.folder_type "
      "FROM moz_bookmarks b "
      "JOIN moz_places_temp h ON b.fk = h.id "
      "LEFT JOIN moz_favicons f ON h.favicon_id = f.id "
      "WHERE b.parent = ?1 "
      "UNION ALL "
      "SELECT h.id, h.url, COALESCE(b.title, h.title), "
        "h.rev_host, h.visit_count, h.last_visit_date, f.url, null, b.id, "
        "b.dateAdded, b.lastModified, b.position, b.type, b.fk, b.folder_type "
      "FROM moz_bookmarks b "
      "JOIN moz_places h ON b.fk = h.id "
      "LEFT JOIN moz_favicons f ON h.favicon_id = f.id "
      "WHERE b.parent = ?1 "
        "AND h.id NOT IN (SELECT id FROM moz_places_temp) "
      "ORDER BY position ASC")

does not seem possible that this query can return dupes, but it does, replacing the second UNION ALL with a UNION fixes failures...

due to the fact both queries do JOIN the entry must exist in both tables, but the h.id NOT IN (SELECT id FROM moz_places_temp) should exclude duplicates( notice dumping tables just before the failure happens shows that the entry is only in moz_places_temp).

The only explanation i could think of is that a sync statement is run after the subquery before the UNION ALL, and before the latest subquery. That would be really bad and scary.
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox-Unittest/1249104472.1249106016.20660.gz

TEST-UNEXPECTED-FAIL | /builds/slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | test failed (with xpcshell return code: 0), see following log:
TEST-UNEXPECTED-FAIL | /builds/slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | 2 == 1 - See following stack:
Unknown Error: command finished with exit code: 1
Depends on: 507790
filed bug 507790 on the underlying issue, according to Sqlite team this is expected, still a bit scary.
We will evaluate perf loss to change all of our UNION ALL to UNION.
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey2.0/1251082602.1251089180.27973.gz
OS X 10.4 comm-central unit test on 2009/08/23 19:56:42
{
TEST-UNEXPECTED-FAIL | ... | test failed (with xpcshell return code: 0), see following log:
TEST-UNEXPECTED-FAIL | ...| 2 == 1 - See following stack:
JS frame :: xpcshell/head.js :: do_throw :: line 159
JS frame :: xpcshell/head.js :: do_check_eq :: line 189
JS frame :: test_utils_getURLsForContainerNode.js :: check_uri_nodes :: line 202
JS frame :: test_utils_getURLsForContainerNode.js :: anonymous :: line 74
JS frame :: test_utils_getURLsForContainerNode.js :: anonymous :: line 209
}
OS: Linux → All
Summary: random failure of test_utils_getURLsForContainerNode.js → xpcshell-tests: random failure of test_utils_getURLsForContainerNode.js
Assignee: mak77 → nobody
Depends on: 521225
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox-Unittest/1255057052.1255059891.12361.gz
Linux mozilla-central test everythingelse on 2009/10/08 19:57:32
{
TEST-UNEXPECTED-FAIL | /builds/moz2_slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | test failed (with xpcshell return code: 0), see following log:
}
{
TEST-UNEXPECTED-FAIL | /builds/moz2_slave/mozilla-central-linux-unittest-everythingelse/build/xpcshell/tests/test_places/unit/test_utils_getURLsForContainerNode.js | 0 == 1 - See following stack:
}
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.6-Unittest/1258188062.1258190686.26680.gz
Linux mozilla-1.9.2 test everythingelse on 2009/11/14 00:41:02
s: moz2-linux-slave42
Whiteboard: [orange] → [orange][workarounded by bug521225 on trunk]
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.6/1267539884.1267540511.21838.gz
Linux mozilla-1.9.2 opt test xpcshell on 2010/03/02 06:24:44
s: mv-moz2-linux-ix-slave06
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.6/1269988494.1269988874.12519.gz
OS X 10.5.2 mozilla-1.9.2 test xpcshell on 2010/03/30 15:34:54
s: moz2-darwin9-slave43
Resolving Places oranges that don't appear on central from at least 6 months.
Check dependencies for bugs that could have fixed the issue.
Please reopen if they re-appear in central.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [orange][workarounded by bug521225 on trunk] → [workarounded by bug521225 on trunk]
You need to log in before you can comment on or make changes to this bug.