Use latest eventlet in probe tests

Note that eventlet 0.22.0+ closes connections between requests when
it stops accepting connections.

Partial-Bug: #1792615
Change-Id: Ia8d9ab95e2aad40e8d797acc3423a917e809ffdb
This commit is contained in:
Tim Burke 2018-09-14 04:42:34 +00:00
parent 17b9acc0a3
commit 050f8799ca
2 changed files with 15 additions and 6 deletions

View File

@ -62,6 +62,10 @@ class TestWSGIServerProcessHandling(unittest.TestCase):
self.assertEqual(resp.status // 100, 4) self.assertEqual(resp.status // 100, 4)
resp.read() resp.read()
# Start the request before reloading...
putrequest(conn, 'PUT', 'blah',
headers={'Content-Length': len(body)})
manager.reload() manager.reload()
post_reload_pids = set(pid for server in manager.servers post_reload_pids = set(pid for server in manager.servers
@ -72,15 +76,19 @@ class TestWSGIServerProcessHandling(unittest.TestCase):
starting_pids, post_reload_pids) starting_pids, post_reload_pids)
self.assertFalse(starting_pids & post_reload_pids, msg) self.assertFalse(starting_pids & post_reload_pids, msg)
# ... and yet we can keep using the same connection! # ... and make sure we can finish what we were doing, and even
putrequest(conn, 'PUT', 'blah', # start part of a new request
headers={'Content-Length': len(body)})
conn.send(body) conn.send(body)
resp = conn.getresponse() resp = conn.getresponse()
self.assertEqual(resp.status // 100, 4) self.assertEqual(resp.status // 100, 4)
resp.read() # We can even read the body
self.assertTrue(resp.read())
# close our connection # After this, we're in a funny spot. With eventlet 0.22.0, the
# connection's now closed, but with prior versions we could keep
# going indefinitely. See https://bugs.launchpad.net/swift/+bug/1792615
# Close our connection, to make sure old eventlet shuts down
conn.close() conn.close()
# sanity # sanity

View File

@ -18,8 +18,8 @@
- name: installing dependencies - name: installing dependencies
yum: name={{ item }} state=present yum: name={{ item }} state=present
with_items: with_items:
- python-eventlet
- python-pyeclib - python-pyeclib
- python-pip
- python-nose - python-nose
- python-swiftclient - python-swiftclient
@ -27,3 +27,4 @@
pip: name={{ item }} state=present extra_args='--upgrade' pip: name={{ item }} state=present extra_args='--upgrade'
with_items: with_items:
- crudini - crudini
- eventlet