Skip to content

Commit

Permalink
tests: Exercise recent eventlet breakage without XFS
Browse files Browse the repository at this point in the history
Recently, upper-constraints updated eventlet. Unfortunately, there
was a bug which breaks our unit tests which was not discovered during
the cross-project testing because the affected unit tests require an
XFS temp dir. The requirements change has since been reverted, but we
ought to have tests that cover the problematic behavior that will
actually run as part of cross-project testing.

See eventlet/eventlet#826 for the eventlet
change that introduced the bug; it has since been fixed on master in
eventlet/eventlet#890 (though we still need
https://review.opendev.org/c/openstack/swift/+/905796 to be able to
work with eventlet master).

Change-Id: I4a6d79317b65f746ee29d2d25073b8c3859cd6a0
  • Loading branch information
tipabu committed Jan 18, 2024
1 parent 2331c9a commit e390781
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/unit/common/test_http_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,28 @@ def test_leading_slashes(self):
lines = [l for l in bytes_out.split(b"\r\n") if l]
self.assertEqual(lines[-1], b'///some-leading-slashes')

def test_chunked_with_content_length(self):
def reflecting_app(env, start_response):
start_response('200 OK', [])
return [env['wsgi.input'].read()]

# This is more of a test of eventlet, but we've seen issues with it
# before that were only caught in unit tests that require an XFS
# tempdir, and so were skipped on the requirements job
bytes_out = self._run_bytes_through_protocol((
b"PUT /path HTTP/1.0\r\n"
b"Content-Length: 10\r\n"
b"Transfer-Encoding: chunked\r\n"
b"\r\n"
b"a\r\n"
b"some text\n"
b"\r\n"
b"0\r\n"
b"\r\n"
), app=reflecting_app)
body = bytes_out.partition(b"\r\n\r\n")[2]
self.assertEqual(body, b'some text\n')

def test_request_lines(self):
def app(env, start_response):
start_response("200 OK", [])
Expand Down

0 comments on commit e390781

Please sign in to comment.