[Windows] xpcshell-tests: test_bug_401430.js fails intermittently

RESOLVED FIXED in mozilla1.9.3a1

Status

()

Toolkit
Downloads API
RESOLVED FIXED
9 years ago
5 years ago

People

(Reporter: sdwilsh, Assigned: mak)

Tracking

({intermittent-failure})

Trunk
mozilla1.9.3a1
x86
Windows Vista
intermittent-failure
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(status1.9.2 .13-fixed, status1.9.1 .16-fixed)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
The test is failing - could be not a long enough timeout, but it is a hardware box, so I'm suspect of that.
Blocks: 401430
(Assignee)

Comment 1

9 years ago
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?
Whiteboard: [orange]
Duplicate of this bug: 464326
{
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));
}
Summary: test_bug_401430.js fails → [Windows] xpcshell-tests: test_bug_401430.js fails intermittently
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
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
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
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
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
(Reporter)

Comment 9

8 years ago
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
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
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.
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.
(Assignee)

Comment 13

8 years ago
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.
(Assignee)

Comment 14

8 years ago
taking to try polling.
Assignee: nobody → mak77
(Assignee)

Comment 15

8 years ago
Created attachment 405495 [details] [diff] [review]
patch v1.0
[Checked in: Comment 18 & 20 & 21]
Attachment #405495 - Flags: review?
(Assignee)

Updated

8 years ago
Attachment #405495 - Flags: review? → review?(edilee)

Comment 16

8 years ago
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
Attachment #405495 - Flags: review?(edilee) → review+
(Assignee)

Comment 17

8 years ago
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
(Assignee)

Comment 18

8 years ago
http://hg.mozilla.org/mozilla-central/rev/23d4e625a481
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
status1.9.1: --- → ?
Flags: wanted1.9.2?
Flags: in-testsuite+
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 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
Attachment #405495 - Attachment description: patch v1.0 → patch v1.0 [Checked in: Comment 18 & 20]
status1.9.2: --- → .12-fixed
Flags: wanted1.9.2?
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
Attachment #405495 - Attachment description: patch v1.0 [Checked in: Comment 18 & 20] → patch v1.0 [Checked in: Comment 18 & 20 & 21]
status1.9.1: ? → .15-fixed
Depends on: 607005
Keywords: intermittent-failure
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.