From 050f8799ca82f121f9d33c7e773b982b9763f074 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Fri, 14 Sep 2018 04:42:34 +0000 Subject: [PATCH] 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 --- test/probe/test_signals.py | 18 +++++++++++++----- .../playbooks/common/install_dependencies.yaml | 3 ++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/test/probe/test_signals.py b/test/probe/test_signals.py index ea475c0d35..f2867fbb5b 100644 --- a/test/probe/test_signals.py +++ b/test/probe/test_signals.py @@ -62,6 +62,10 @@ class TestWSGIServerProcessHandling(unittest.TestCase): self.assertEqual(resp.status // 100, 4) resp.read() + # Start the request before reloading... + putrequest(conn, 'PUT', 'blah', + headers={'Content-Length': len(body)}) + manager.reload() post_reload_pids = set(pid for server in manager.servers @@ -72,15 +76,19 @@ class TestWSGIServerProcessHandling(unittest.TestCase): starting_pids, post_reload_pids) self.assertFalse(starting_pids & post_reload_pids, msg) - # ... and yet we can keep using the same connection! - putrequest(conn, 'PUT', 'blah', - headers={'Content-Length': len(body)}) + # ... and make sure we can finish what we were doing, and even + # start part of a new request conn.send(body) resp = conn.getresponse() 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() # sanity diff --git a/tools/playbooks/common/install_dependencies.yaml b/tools/playbooks/common/install_dependencies.yaml index b2fe7fe8ea..bbec2d5404 100644 --- a/tools/playbooks/common/install_dependencies.yaml +++ b/tools/playbooks/common/install_dependencies.yaml @@ -18,8 +18,8 @@ - name: installing dependencies yum: name={{ item }} state=present with_items: - - python-eventlet - python-pyeclib + - python-pip - python-nose - python-swiftclient @@ -27,3 +27,4 @@ pip: name={{ item }} state=present extra_args='--upgrade' with_items: - crudini + - eventlet