Closed Bug 681840 Opened 13 years ago Closed 13 years ago

Print helpful warning when starting test HTTP server fails

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: rnewman, Assigned: rnewman)

References

()

Details

(Whiteboard: [qa-])

Attachments

(1 file)

gps just got bit by this. Not letting perfect be the enemy of good, let's log something useful when the test server port is already in use.
Turns out that the error is thrown on the calling thread, so we can easily get output during tests like:


TEST-INFO | (xpcshell/head.js) | test 2 pending
==========================================
Got exception starting HTTP server on port 8080
Error: 2147746065 No traceback available
Is there a process already listening on port 8080?
==========================================
 
TEST-UNEXPECTED-FAIL | /home/gps/src/mozilla-central/obj-ff-debug/_tests/xpcshell/services/sync/tests/unit/head_http_server.js | 2147746065 - See following stack:


That's what this patch does. It'd be nice if httpd.js threw Components.Exceptions instead of raw error codes, but this will do for now. gps confirmed that this would have clued him in sooner :)

Sync unit tests pass.
Attachment #556101 - Flags: review?(philipp)
Comment on attachment 556101 [details] [diff] [review]
Proposed patch. v1

Nit: Trailing whitespace.
Attachment #556101 - Flags: review?(philipp) → review+
https://hg.mozilla.org/services/services-central/rev/62177ac1ccad

and fixing the darn whitespace that I shouldn't have included in the first place:

https://hg.mozilla.org/services/services-central/rev/74a49fef4fc4

QA: In principle this is testable -- start an HTTP server on port 8080, verify that you get a pretty error message when running a test that requires HTTP -- but don't spend too much time on it.
Whiteboard: [fixed in services][qa-]
http://hg.mozilla.org/mozilla-central/rev/62177ac1ccad
http://hg.mozilla.org/mozilla-central/rev/74a49fef4fc4
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services][qa-] → [qa-]
Target Milestone: --- → mozilla9
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: