Closed
Bug 630599
Opened 14 years ago
Closed 14 years ago
Multiple initialized httpd objects are using up multiple ports during test runs
Categories
(Testing Graveyard :: Mozmill, defect)
Testing Graveyard
Mozmill
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: aaronmt, Assigned: ahal)
References
Details
(Whiteboard: [mozmill-1.5.2+][mozmill-2.0+])
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
harth
:
review+
|
Details | Diff | Splinter Review |
Using 1.5.2RC2 I have noticed that during test-runs that use localhost, multiple ports were being used. Under 1.5.1, we seem to initialize a single server ran on a single port throughout a test-run
Example output on ports used by firefox-bin on localhost
tcp 0 0 localhost.localdo:43336 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43337 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43338 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43339 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43340 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43341 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43342 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43343 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43344 *:* LISTEN 2904/firefox-bin
tcp 0 0 localhost.localdo:43345 *:* LISTEN 2904/firefox-bin
Steps to Reproduce
1. Install and setup mozmill 1.5.2rc2
2. Clone http://hg.mozilla.org/qa/mozmill-tests/
3. mozmill -t firefox/testAwesomebar -b <path to binary>
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → ahalberstadt
Assignee | ||
Updated•14 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 1•14 years ago
|
||
You can list all listened to ports with netstat -lptuc
Assignee | ||
Comment 2•14 years ago
|
||
So the ports aren't getting closed after a module has been run. I'll have to look into whether this is our fault or httpd.js' fault.
The relevant code is here: https://github.com/mozautomation/mozmill/blob/hotfix-1.5.2/mozmill/mozmill/extension/resource/modules/frame.js#L331
At this point I don't think that this is the cause for bug 630258. It appears that things have always worked this way and I get all tests passing in the reproduction steps above.
As an aside, this code also raises a separate issue. If we ever hit an error getting the httpd server that isn't related to ports, we'll be stuck in an infinite loop. At the very least I think we should limit the number of times we attempt a connection with a new port. However we should probably try to catch the specific exception for a port conflict.
Comment 3•14 years ago
|
||
Do we really want to shutdown/start httpd for each single test module? I don't think that this is optimal. It would cause a lot of delays.
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3)
> Do we really want to shutdown/start httpd for each single test module? I don't
> think that this is optimal. It would cause a lot of delays.
Currently this is not how things work. We already are creating a new httpd object for each test module. I agree that this is not optimal.
Unfortunately, after looking into this a bit more, things are even worse than I thought. Not only are we creating a new httpd object for each module, but we aren't stopping the old httpd objects from previous modules. This explains why the ports are being left open.
This function never gets called: https://github.com/mozautomation/mozmill/blob/hotfix-1.5.2/mozmill/mozmill/extension/resource/modules/frame.js#L343
and we create a new collector object (which in turn creates a new httpd object) for each test module: https://github.com/mozautomation/mozmill/blob/hotfix-1.5.2/mozmill/mozmill/extension/resource/modules/frame.js#L662
I don't know what the implications of fixing this for 1.5.2 are. I'd recommend at least stopping the httpd server properly for 1.5.2 and then for 2.0 maybe make the httpd server persist across test modules.
Comment 5•14 years ago
|
||
This failure has been exposed by the patch on bug 615144. As Andrew told on IRC it was only hidden before.
Keywords: regression
Whiteboard: [mozmill-1.5.2] → [mozmill-1.5.2?]
Assignee | ||
Updated•14 years ago
|
Whiteboard: [mozmill-1.5.2?] → [mozmill-1.5.2?][mozmill-2.0?]
Assignee | ||
Comment 6•14 years ago
|
||
Used https://developer.mozilla.org/En/Httpd.js/HTTP_server_for_unit_tests for information on how to properly stop the httpd server.
Attachment #508884 -
Flags: review?(ctalbert)
Whiteboard: [mozmill-1.5.2?][mozmill-2.0?] → [mozmill-1.5.2+][mozmill-2.0+]
Comment on attachment 508884 [details] [diff] [review]
Patch 1.0 - Stop the httpd object after each test module
Thanks for jumping on this!
Attachment #508884 -
Flags: review?(ctalbert) → review+
Assignee | ||
Comment 8•14 years ago
|
||
master: https://github.com/mozautomation/mozmill/commit/b7ad92ee31c97ccfc685bdf4640aea1312f186ee
hotfix-1.5.2: https://github.com/mozautomation/mozmill/commit/332e3bdc8f34eaeb0f4244f61461c70f7ade96dc
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 9•14 years ago
|
||
Works great:
http://mozmill-archive.brasstacks.mozilla.com/#/general/report/49f8dadbae23fe2f040450708a04b65b
http://mozmill-archive.brasstacks.mozilla.com/#/general/report/49f8dadbae23fe2f040450708a04b55d
Watched the testrun and we now stick with the same port across all tests.
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 10•14 years ago
|
||
I'm actually going to reopen this. I forgot to add a check to make sure that collector.httpd actually exists, so we hit a javascript error when we call the httpd.stop method.
Fix is a simple if statement, will have it up in a bit.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 11•14 years ago
|
||
Check to make sure collector.httpd exists before calling httpd.stop
Attachment #508884 -
Attachment is obsolete: true
Attachment #508975 -
Flags: review?(fayearthur+bugs)
Assignee | ||
Comment 12•14 years ago
|
||
Attachment #508975 -
Attachment is obsolete: true
Attachment #508979 -
Flags: review?(fayearthur+bugs)
Attachment #508975 -
Flags: review?(fayearthur+bugs)
Comment 13•14 years ago
|
||
Comment on attachment 508979 [details] [diff] [review]
Patch 1.1 - Check that the collector.httpd exists before calling httpd.stop
thanks for the fast fix!
Attachment #508979 -
Flags: review?(fayearthur+bugs) → review+
Assignee | ||
Comment 14•14 years ago
|
||
master: https://github.com/mozautomation/mozmill/commit/c402fb93e4b88bc87ddd9ac785a7787c957bf72a
hotfix-1.5.2: https://github.com/mozautomation/mozmill/commit/317bc8da192c11d3adb4fdbdedcb7b791d0b2814
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Comment 15•14 years ago
|
||
Works great and the restart issue is also fixed. Marking as verified fixed.
Status: RESOLVED → VERIFIED
Updated•8 years ago
|
Product: Testing → Testing Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•