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
=== modified file 'systemimage/testing/helpers.py'
--- systemimage/testing/helpers.py 2013-09-24 21:52:55 +0000
+++ systemimage/testing/helpers.py 2013-09-25 23:55:00 +0000
@@ -53,6 +53,7 @@
53from systemimage.index import Index53from systemimage.index import Index
54from threading import Thread54from threading import Thread
55from unittest.mock import patch55from unittest.mock import patch
56from socket import SHUT_RDWR
5657
5758
58EMPTYSTRING = ''59EMPTYSTRING = ''
@@ -157,6 +158,8 @@
157 import time; start = time.time()158 import time; start = time.time()
158 #print('CONN:', connections, file=sys.stderr)159 #print('CONN:', connections, file=sys.stderr)
159 for conn in connections:160 for conn in connections:
161 if conn.fileno() != -1:
162 conn.shutdown(SHUT_RDWR)
160 conn.close()163 conn.close()
161 server.shutdown()164 server.shutdown()
162 end = time.time()165 end = time.time()

Subscribers

People subscribed via source and target branches

to all changes: