tempest/api/object_storage/test_object_expiry.py tests are brittle

Bug #2049772 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
New
Undecided
Unassigned

Bug Description

I recently saw a job fail like https://paste.opendev.org/show/bEzUCQkkSKNjPcxxHbYO/

(Full logs at https://zuul.opendev.org/t/openstack/build/861a21dd3733458f9a24a44568f811fa)

The relevant bit of the client request log had:

2024-01-18 07:22:04,117 92025 INFO [tempest.lib.common.rest_client] Request (ObjectExpiryTest:test_get_object_at_expiry_time): 202 POST https://149.202.175.140:8080/v1/AUTH_6d200273094a41abb168960eff18966b/tempest-TestContainer-112
    1234332/tempest-TestObject-1439857436 32.638s
2024-01-18 07:22:04,118 92025 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'X-Delete-At': '1705562501', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'date': 'Thu, 18 Jan 2024 07:22:04 GMT', <snip>}
        Body: b'<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>'
2024-01-18 07:22:04,160 92025 INFO [tempest.lib.common.rest_client] Request (ObjectExpiryTest:test_get_object_at_expiry_time): 404 HEAD https://149.202.175.140:8080/v1/AUTH_6d200273094a41abb168960eff18966b/tempest-TestContainer-1121234332/tempest-TestObject-1439857436 0.041s
2024-01-18 07:22:04,160 92025 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'date': 'Thu, 18 Jan 2024 07:22:04 GMT', <snip>}
        Body: b''

That is, the POST request took 30s to complete, so the expiry time of "now + 10s" [0] had already passed by the time it did the subsequent HEAD. The 404 is then expected behavior for Swift: the POST was timestamped as of the initial request time (so it shouldn't 400 with 'X-Delete-At in past') and the HEAD came after expiry had passed.

Note that we've seen similar trouble a few times before:

https://bugs.launchpad.net/tempest/+bug/1269597
https://bugs.launchpad.net/tempest/+bug/1304119
https://bugs.launchpad.net/tempest/+bug/1410065

I'm not sure that the test *can* be made reliable without either

 - (sometimes) skipping the "HEAD/GET should still 200 after POST" check (which seems to materially change the nature of the test) or
 - using expiration delays on the order of minutes (which has other obvious downsides)

Maybe we could at least track the request time for the POST and retry the setup to that point if it's been more than the delay?

[0] https://opendev.org/openstack/tempest/src/commit/01c2e2ff/tempest/api/object_storage/test_object_expiry.py#L97

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.