Last Comment Bug 450807 - [Windows] xpcshell-tests: test_bug_401430.js fails intermittently
: [Windows] xpcshell-tests: test_bug_401430.js fails intermittently
Status: RESOLVED FIXED
: intermittent-failure
Product: Toolkit
Classification: Components
Component: Download Manager (show other bugs)
: Trunk
: x86 Windows Vista
: -- normal (vote)
: mozilla1.9.3a1
Assigned To: Marco Bonardo [::mak] (Away 6-20 Aug)
:
Mentors:
http://mxr.mozilla.org/mozilla-centra...
: 464326 (view as bug list)
Depends on: 607005
Blocks: 401430 438871
  Show dependency treegraph
 
Reported: 2008-08-15 14:02 PDT by Shawn Wilsher :sdwilsh
Modified: 2012-11-25 19:31 PST (History)
9 users (show)
bugzillamozillaorg_serge_20140323: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
.13-fixed
.16-fixed


Attachments
patch v1.0 [Checked in: Comment 18 & 20 & 21] (2.62 KB, patch)
2009-10-09 08:40 PDT, Marco Bonardo [::mak] (Away 6-20 Aug)
edilee: review+
Details | Diff | Splinter Review

Description Shawn Wilsher :sdwilsh 2008-08-15 14:02:17 PDT
The test is failing - could be not a long enough timeout, but it is a hardware box, so I'm suspect of that.
Comment 1 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-01-08 04:46:11 PST
today's failure on 1.9.1 branch:
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.1/1231411433.1231416615.20356.gz

is Bug 464326 the same?
Comment 2 :Gavin Sharp [email: gavin@gavinsharp.com] 2009-05-06 12:35:13 PDT
*** Bug 464326 has been marked as a duplicate of this bug. ***
Comment 3 Serge Gautherie (:sgautherie) 2009-06-12 17:35:00 PDT
{
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey-Ports/1244838990.1244845362.4040.gz
WINNT 5.2 comm-1.9.1 unit test on 2009/06/12 13:36:30

TEST-UNEXPECTED-FAIL | e:\builds\slave\comm-1.9.1-win32-unittest\build\objdir\mozilla\_tests\xpcshell\test_dm\unit\test_bug_401430.js | false == true - See following stack:
[...]
JS frame :: e:\builds\slave\comm-1.9.1-win32-unittest\build\objdir\mozilla\_tests\xpcshell\test_dm\unit\test_bug_401430.js :: checkResult :: line 46
}

Code is:
{
45 function checkResult() {
46   do_check_true(checkRecentDocsFor(resultFileName));
}
Comment 4 Serge Gautherie (:sgautherie) 2009-08-04 14:18:35 PDT
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey2.0/1249405006.1249415404.9480.gz
WINNT 5.2 comm-1.9.1 unit test on 2009/08/04 09:56:46
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey2.0/1249411693.1249420049.27935.gz
WINNT 5.2 comm-1.9.1 unit test on 2009/08/04 11:48:13
Comment 5 Serge Gautherie (:sgautherie) 2009-08-11 10:32:29 PDT
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird3.0/1250005445.1250009862.10101.gz
Win2k3 comm-1.9.1 check on 2009/08/11 08:44:05
Comment 6 Serge Gautherie (:sgautherie) 2009-08-21 09:25:28 PDT
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird3.0/1250858939.1250865428.10142.gz
Win2k3 comm-1.9.1 check on 2009/08/21 05:48:59
Comment 7 Serge Gautherie (:sgautherie) 2009-08-24 12:16:11 PDT
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird/1251129177.1251132479.12584.gz
Win2k3 comm-central check on 2009/08/24 08:52:57
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird/1251134152.1251138704.21994.gz
Win2k3 comm-central check on 2009/08/24 10:15:52
Comment 8 Serge Gautherie (:sgautherie) 2009-09-01 05:40:08 PDT
http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird3.0/1251797227.1251801034.445.gz
Win2k3 comm-1.9.1 check on 2009/09/01 02:27:07
Comment 9 Shawn Wilsher :sdwilsh 2009-09-10 16:57:35 PDT
WINNT 5.2 mozilla-central test everythingelse [testfailed] Started 15:32, finished 16:09
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox-Unittest/1252621947.1252624104.20979.gz&fulltext=1
Comment 10 Johnathan Nightingale [:johnath] 2009-09-29 05:58:09 PDT
This test has been touched by Ted, Gavin and Ehsan, and is still failing. Any of you three have thoughts?

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.6-Unittest/1254222761.1254225210.9086.gz
WINNT 5.2 mozilla-1.9.2 test everythingelse on 2009/09/29 04:12:41
Comment 11 Ted Mielczarek [:ted.mielczarek] 2009-09-29 06:05:10 PDT
My changes were mostly just a tree-wide refactoring, and then a followup fix to the test as fallout from that. The test checks that downloaded files get put into the "Recent Documents" list. My refactoring change accidentally caused the file to get downloaded to $TEMP, which apparently means the file doesn't go into "Recent Documents", so I changed the test to download to the test directory instead.
Comment 12 :Gavin Sharp [email: gavin@gavinsharp.com] 2009-10-05 07:41:53 PDT
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/downloads/test/unit/test_bug_401430.js#107

The test uses an arbitrarily-chosen 1000ms timeout, because apparently the change to the registry in response to the SHAddToRecentDocs call doesn't happen synchronously (our registry APIs can't get the new value immediately, anyways).

I'm not sure that there's much we can do to address this besides removing the test or just increasing the timeout.
Comment 13 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-10-05 07:53:15 PDT
we can use a polling strategy, check after 1000ms, if it's not present check again after 500ms or so, till we reach a max timing of 5s.
Comment 14 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-10-08 18:20:30 PDT
taking to try polling.
Comment 15 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-10-09 08:40:23 PDT
Created attachment 405495 [details] [diff] [review]
patch v1.0
[Checked in: Comment 18 & 20 & 21]
Comment 16 Ed Lee :Mardak 2009-10-09 13:30:20 PDT
Comment on attachment 405495 [details] [diff] [review]
patch v1.0
[Checked in: Comment 18 & 20 & 21]

>--- a/toolkit/components/downloads/test/unit/test_bug_401430.js
> function checkResult() {
>   // delete the saved file (this doesn't affect the "recent documents" list)
>   var resultFile = do_get_file(resultFileName);
>   resultFile.remove(false);
> 
>+  // Need to poll RecentDocs value because the SHAddToRecentDocs call
>+  // doesn't update the registry immediately.
>+  do_timeout(POLL_REGISTRY_TIMEOUT, "pollRecentDocs();");
I suppose you could just call pollRecentDocs() instead of on a timeout, but you can leave as is.

r=Mardak
Comment 17 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-10-09 13:32:39 PDT
yes but i prefer giving some breath to the main thread in tests, and i really doubt the value will be in the registry immediately. so i did that
Comment 18 Marco Bonardo [::mak] (Away 6-20 Aug) 2009-10-10 03:19:35 PDT
http://hg.mozilla.org/mozilla-central/rev/23d4e625a481
Comment 19 Serge Gautherie (:sgautherie) 2010-08-31 20:13:48 PDT
Bug still on m-1.9.1:
http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey2.0/1283272317.1283282005.17096.gz
WINNT 5.2 comm-1.9.1 unit test on 2010/08/31 09:31:57
Comment 20 Serge Gautherie (:sgautherie) 2010-10-25 05:15:04 PDT
Comment on attachment 405495 [details] [diff] [review]
patch v1.0
[Checked in: Comment 18 & 20 & 21]

http://hg.mozilla.org/releases/mozilla-1.9.2/rev/9e91f8ff24c8
Comment 21 Serge Gautherie (:sgautherie) 2010-10-25 10:16:52 PDT
Comment on attachment 405495 [details] [diff] [review]
patch v1.0
[Checked in: Comment 18 & 20 & 21]

http://hg.mozilla.org/releases/mozilla-1.9.1/rev/75b0292a274a

Note You need to log in before you can comment on or make changes to this bug.