Skip to content

Commit 13dc2e4

Browse files
authored
Merge pull request #97 from stackhpc/upstream/2024.1-2025-05-19
Synchronise 2024.1 with upstream
2 parents 14c85f5 + a514df4 commit 13dc2e4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

glance/tests/functional/v2/test_images_import_locking.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ def slow_fake_set_data(data_iter, size=None, backend=None,
9191

9292
# Try a second copy-image import. If we are warping time,
9393
# expect the lock to be busted. If not, then we should get
94-
# a 409 Conflict.
95-
resp = self._import_copy(image_id, ['store3'])
96-
time.sleep(0.1)
94+
# a 409 Conflict. We should make sure to wait until it gets started
95+
# before looking for the task id.
96+
with mock.patch('glance.location.ImageProxy.set_data') as mock_sd:
97+
mock_sd.side_effect = slow_fake_set_data
98+
resp = self._import_copy(image_id, ['store3'])
99+
100+
# Wait to make sure the data stream gets started
101+
for i in range(0, 10):
102+
if 'running' in state:
103+
break
104+
time.sleep(0.1)
97105

98106
self.addDetail('Second import response',
99107
ttc.text_content(str(resp)))

0 commit comments

Comments
 (0)