Fix intermittent failure in test_x_delete_after

X-Delete-After: 1 is known to be flakey; use 2 instead.

When the proxy receives an X-Delete-After header, it automatically
converts it to an X-Delete-At header based on the current time. So far,
so good. But in normalize_delete_at_timestamp we convert our

    time.time() + int(req.headers['X-Delete-After'])

to a string representation of an integer and in the process always round
*down*. As a result, we lose up to a second worth of object validity,
meaning the object server can (rarely) respond 400, complaining that the
X-Delete-At is in the past.

Change-Id: Ib5e5a48f5cbed0eade8ba3bca96b26c82a9f9d84
Related-Change: I643be9af8f054f33897dd74071027a739eaa2c5c
Related-Change: I10d3b9fcbefff3c415a92fa284a1ea1eda458581
Related-Change: Ifdb1920e5266aaa278baa0759fc0bfaa1aff2d0d
Related-Bug: #1597520
Closes-Bug: #1699114
This commit is contained in:
Tim Burke 2017-09-27 19:19:53 +00:00
parent ff23dcdf3a
commit c6aea4b373

View File

@ -379,7 +379,7 @@ class TestObject(unittest2.TestCase):
'x_delete_after'),
'', {'X-Auth-Token': token,
'Content-Length': '0',
'X-Delete-After': '1'})
'X-Delete-After': '2'})
return check_response(conn)
resp = retry(put)
resp.read()
@ -400,7 +400,7 @@ class TestObject(unittest2.TestCase):
resp = retry(get)
resp.read()
count += 1
time.sleep(1)
time.sleep(0.5)
self.assertEqual(resp.status, 404)