Closed
Bug 553995
Opened 14 years ago
Closed 14 years ago
test_bug_406857.js blocks when example.com is not reachable
Categories
(Toolkit :: Downloads API, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a5
People
(Reporter: glandium, Assigned: glandium)
Details
Attachments
(1 file, 1 obsolete file)
2.11 KB,
patch
|
sdwilsh
:
review+
|
Details | Diff | Splinter Review |
When example.com is not reachable for any reason (firewall, lack of network connectivity, ...), test_bug_406857.js blocks indefinitely.
Assignee | ||
Updated•14 years ago
|
Attachment #433899 -
Attachment is patch: true
Attachment #433899 -
Attachment mime type: application/octet-stream → text/plain
Attachment #433899 -
Flags: review?(benjamin)
Comment 1•14 years ago
|
||
I was going to suggest using mochi.test, but it looks like that change doesn't apply to xpcshell tests (I guess because they don't use the same PAC config as mochitest-based tests?).
Assignee | ||
Comment 2•14 years ago
|
||
AFAICS, xpcshell tests don't use a PAC config at all.
Updated•14 years ago
|
Attachment #433899 -
Flags: review?(benjamin) → review?(sdwilsh)
Comment 3•14 years ago
|
||
This doesn't seem to apply cleanly, and only has three lines of context. Can you upload an updated patch with more context please?
Updated•14 years ago
|
Attachment #433899 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3) > This doesn't seem to apply cleanly, and only has three lines of context. Can > you upload an updated patch with more context please? I don't know where you tried to apply the patch but it applies cleanly here on m-c, without any fuzz or offset.
Assignee | ||
Updated•14 years ago
|
Attachment #433899 -
Flags: review?(sdwilsh)
Updated•14 years ago
|
Attachment #433899 -
Flags: review?(sdwilsh) → review+
Comment 5•14 years ago
|
||
Comment on attachment 433899 [details] [diff] [review] Patch constify the port number and and use it in both places. Also, make sure you stop the http server please. In the future please upload patches with more context. r=sdwilsh with those changes.
Assignee | ||
Comment 6•14 years ago
|
||
(In reply to comment #5) > (From update of attachment 433899 [details] [diff] [review]) > constify the port number and and use it in both places. > > Also, make sure you stop the http server please. Interestingly, none of the above is being done in other tests using the http server. The former, apparently nowhere, and the latter apparently only on a few download manager tests. I do wonder if that wouldn't be a bug ? (for the latter, especially considering that I sometimes have xpcshell tests freezing)
Assignee | ||
Comment 7•14 years ago
|
||
Actually, head_download_manager takes care of stopping the http server if a global httpserv variable is used for it. As for my xpcshell tests freeze, it's because of unhandled failures in the test suite... that leads to do_test_pending without the corresponding do_test_finished. I'll file a new bug about that.
Comment 8•14 years ago
|
||
(In reply to comment #6) > Interestingly, none of the above is being done in other tests using the http > server. The former, apparently nowhere, and the latter apparently only on a few > download manager tests. I do wonder if that wouldn't be a bug ? (for the > latter, especially considering that I sometimes have xpcshell tests freezing) Yeah, shame on me for not pushing for having the port number constified in other download manager tests. I've been trying to push to get things clearer as new tests are written or old ones revised to improve this situation. As for stopping the http server, I bet it can manage itself, but again, I'd prefer to be explicit in tests.
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #8) > As for stopping the http server, I bet it can manage itself, but again, I'd > prefer to be explicit in tests. Well, in download manager tests, it appears head_download_manager already handles this, so doing it explicitely will actually fail, since the httpserver throws in case it is already stopped. Sure, we could put the stop in a catch clause but that sounds so wrong.
Comment 10•14 years ago
|
||
(In reply to comment #9) > Well, in download manager tests, it appears head_download_manager already > handles this, so doing it explicitely will actually fail, since the httpserver > throws in case it is already stopped. Sure, we could put the stop in a catch > clause but that sounds so wrong. But only the global httpserv (which this test does not use), and only if you call getDownloadListener, which this test does not use.
Assignee | ||
Comment 11•14 years ago
|
||
Assignee: nobody → mh+mozilla
Attachment #433899 -
Attachment is obsolete: true
Attachment #440719 -
Flags: review?(sdwilsh)
Comment 12•14 years ago
|
||
Comment on attachment 440719 [details] [diff] [review] Patch v2 r=sdwilsh Thanks for putting up with my pickiyness.
Attachment #440719 -
Flags: review?(sdwilsh) → review+
Assignee | ||
Comment 13•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/2d1b5789e211
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in
before you can comment on or make changes to this bug.
Description
•