Merge lp:~vorlon/ubuntu-system-image/lp1196991 into lp:~barry/ubuntu-system-image/lp1196991

Proposed by Steve Langasek
Status: Merged
Approved by: Barry Warsaw
Approved revision: 174
Merge reported by: Barry Warsaw
Merged at revision: not available
Proposed branch: lp:~vorlon/ubuntu-system-image/lp1196991
Merge into: lp:~barry/ubuntu-system-image/lp1196991
Diff against target: 20 lines (+3/-0)
1 file modified
systemimage/testing/helpers.py (+3/-0)
To merge this branch: bzr merge lp:~vorlon/ubuntu-system-image/lp1196991
Reviewer Review Type Date Requested Status
Barry Warsaw Approve
Review via email: mp+187631@code.launchpad.net

Description of the change

Partial fix for the hangs in the testsuite waiting for the http server to
shutdown. Sometimes the server still waits 2 minutes while shutting down,
even though the socket has been closed - the delay is in server.shutdown(),
not in conn.close(), so it's probably something to do with the ssl socket
wrapper or the HTTPServer connection state.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

This looks like it's still useful as a safety net. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'systemimage/testing/helpers.py'
2--- systemimage/testing/helpers.py 2013-09-24 21:52:55 +0000
3+++ systemimage/testing/helpers.py 2013-09-25 23:55:00 +0000
4@@ -53,6 +53,7 @@
5 from systemimage.index import Index
6 from threading import Thread
7 from unittest.mock import patch
8+from socket import SHUT_RDWR
9
10
11 EMPTYSTRING = ''
12@@ -157,6 +158,8 @@
13 import time; start = time.time()
14 #print('CONN:', connections, file=sys.stderr)
15 for conn in connections:
16+ if conn.fileno() != -1:
17+ conn.shutdown(SHUT_RDWR)
18 conn.close()
19 server.shutdown()
20 end = time.time()

Subscribers

People subscribed via source and target branches

to all changes: