Opened on 01/25/2016 at 11:05:17 AM
Closed on 02/01/2016 at 12:59:59 PM
#3572 closed defect (fixed)
Cannot restart UI test environment if Python keeps port open
Reported by: | greiner | Assignee: | greiner |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | User-Interface | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by greiner)
Environment
Ubuntu 14.04
How to reproduce
- Start test server with ./test_server.py
- Open http://localhost:5000/options.html
- Kill process using CTRL+C
Observed behavior
Console shows the following error message:
socket.error: [Errno 98] Address already in use
Expected behavior
Server should start up normally without any error messages being shown.
Background
Python keeps ports open in case any extra packets show up so telling it to reuse those should be sufficient. However, that requires us to manually bind to the port.
What to change
- Set the third argument in the server constructor to False to indicate that we want to bind to the port manually.
- Set the server's allow_reuse_address property to True.
- Call server_bind() and server_activate() before starting the server.
Attachments (0)
Change History (5)
comment:3 Changed on 01/25/2016 at 06:53:33 PM by greiner
- Owner set to greiner
comment:4 Changed on 01/25/2016 at 06:59:21 PM by greiner
- Status changed from new to reviewing
Note: See
TracTickets for help on using
tickets.
https://codereview.adblockplus.org/29334529/