Skip to content

Commit 6ba656b

Browse files
authored
marvin: Fix intermittent failure observed in test_02_list_snapshots_with_removed_data_store (apache#5483)
* marvin: Fix intermittent failure observed in test_02_list_snapshots_with_removed_data_store * refactor test
1 parent 50a0e80 commit 6ba656b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

test/integration/smoke/test_snapshots.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,23 +245,30 @@ def test_02_list_snapshots_with_removed_data_store(self):
245245
PASS,
246246
"Invalid response returned for list volumes")
247247
vol_uuid = vol_res[0].id
248-
249-
# Create new Primary Storage
250248
clusters = list_clusters(
251249
self.apiclient,
252250
zoneid=self.zone.id
253251
)
254252
assert isinstance(clusters,list) and len(clusters)>0
255253

254+
self.cleanup.append(self.virtual_machine_with_disk)
255+
256+
# Attach created volume to vm, then detach it to be able to migrate it
257+
self.virtual_machine_with_disk.stop(self.apiclient)
258+
self.virtual_machine_with_disk.attach_volume(
259+
self.apiclient,
260+
vol
261+
)
262+
263+
# Create new Primary Storage
256264
storage = StoragePool.create(self.apiclient,
257265
self.services["nfs2"],
258266
clusterid=clusters[0].id,
259267
zoneid=self.zone.id,
260268
podid=self.pod.id
261269
)
262-
self.cleanup.append(self.virtual_machine_with_disk)
263-
self.cleanup.append(storage)
264270

271+
self.cleanup.append(storage)
265272
self.assertEqual(
266273
storage.state,
267274
'Up',
@@ -296,12 +303,6 @@ def test_02_list_snapshots_with_removed_data_store(self):
296303
"Check storage pool type "
297304
)
298305

299-
# Attach created volume to vm, then detach it to be able to migrate it
300-
self.virtual_machine_with_disk.stop(self.apiclient)
301-
self.virtual_machine_with_disk.attach_volume(
302-
self.apiclient,
303-
vol
304-
)
305306
self.virtual_machine_with_disk.detach_volume(
306307
self.apiclient,
307308
vol

0 commit comments

Comments
 (0)