We've been writing SLO manifests with size/etag sysmeta for more than 5
years, but we want our tests and code to continue to support the legacy
format forever. This test infra refactor will make that easier for test
authors to opt-in testing of legacy manifests by reusing a common
pattern for manifest setup across tests.
This consolidation also cleans up some duplication where two TestCases
had identical manifest setup and paves the way to more tidying of
similar (but slightly different) manifest setup across TestCases and
sharing of setup across future TestCases.
This manifest setup standardization also adopts a consistent naming
scheme for manifest sysmeta values so test assertions are easier to read
as correct at a glance (e.g. slo_etag vs json_md5)
Additionally leak tracking is added to the common base; SLO was already
really good about *closing* requests, but in many cases seems to not
bother reading/draining them (even when they might be empty/small).
As part of the leak tracking investigation a couple new tests were added
to explore the behavior of SLO's SegmentedIterable in the
request_helpers module.
Drive-By: Fix SegmentedIterable docstring: the constructor has
expected an iterable yielding dicts, not tuples, since the
Related-Change [2].
Drive-By: remove FakeSwift's now unused "register_responses" interface
and provide "register_next_response" as a replacment. This allows test
authors to extend the registered response for a given request key from a
common test setup into a "series of registered responses" by expressing
just the new/next response rather than forcing them to duplicate the
initial response in the explicit list passed to "register_responses".
Reviewed: https:/ /review. opendev. org/c/openstack /swift/ +/896466 /opendev. org/openstack/ swift/commit/ 3dab88bdf83eba3 39cd1a2d391b9e4 21ff2c5cf0
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 3dab88bdf83eba3 39cd1a2d391b9e4 21ff2c5cf0
Author: Clay Gerrard <email address hidden>
Date: Fri Sep 22 14:48:41 2023 -0500
tests: refactor SLO size/etag sysmeta tests
We've been writing SLO manifests with size/etag sysmeta for more than 5
years, but we want our tests and code to continue to support the legacy
format forever. This test infra refactor will make that easier for test
authors to opt-in testing of legacy manifests by reusing a common
pattern for manifest setup across tests.
This consolidation also cleans up some duplication where two TestCases
had identical manifest setup and paves the way to more tidying of
similar (but slightly different) manifest setup across TestCases and
sharing of setup across future TestCases.
This manifest setup standardization also adopts a consistent naming
scheme for manifest sysmeta values so test assertions are easier to read
as correct at a glance (e.g. slo_etag vs json_md5)
Additionally leak tracking is added to the common base; SLO was already
really good about *closing* requests, but in many cases seems to not
bother reading/draining them (even when they might be empty/small).
As part of the leak tracking investigation a couple new tests were added
to explore the behavior of SLO's SegmentedIterable in the
request_helpers module.
Drive-By: Fix SegmentedIterable docstring: the constructor has
expected an iterable yielding dicts, not tuples, since the
Related-Change [2].
Drive-By: remove FakeSwift's now unused "register_ responses" interface next_response" as a replacment. This allows test responses" .
and provide "register_
authors to extend the registered response for a given request key from a
common test setup into a "series of registered responses" by expressing
just the new/next response rather than forcing them to duplicate the
initial response in the explicit list passed to "register_
Related-Bug: #2040178 5560b005cea750a a64a88c96f9 e6da7d6b819af79 582b671d699 6b755ec19cc9315 d06a6ca8b15
Co-Authored-By: Alistair Coles <email address hidden>
[1] Related-Change: Ia6ad3235410551
[2] Related-Change-Id: Ib8dc216a84d370
Change-Id: I54094f3d2098f5