Skip to content

Commit 3b42fbf

Browse files
authored
Fixing CI failures (#12789)
* Fixing CI failures * fixup: test_secondary_storage
1 parent 27bce46 commit 3b42fbf

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

engine/schema/src/main/java/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDaoImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
6767
private SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStoreRoleEqStateNeqRefCntNeq;
6868
protected SearchBuilder<SnapshotDataStoreVO> searchFilteringStoreIdEqStateEqStoreRoleEqIdEqUpdateCountEqSnapshotIdEqVolumeIdEq;
6969
private SearchBuilder<SnapshotDataStoreVO> stateSearch;
70-
private SearchBuilder<SnapshotDataStoreVO> idStateNeqSearch;
70+
private SearchBuilder<SnapshotDataStoreVO> idStateNinSearch;
7171
protected SearchBuilder<SnapshotVO> snapshotVOSearch;
7272
private SearchBuilder<SnapshotDataStoreVO> snapshotCreatedSearch;
7373
private SearchBuilder<SnapshotDataStoreVO> dataStoreAndInstallPathSearch;
@@ -146,10 +146,10 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
146146
stateSearch.done();
147147

148148

149-
idStateNeqSearch = createSearchBuilder();
150-
idStateNeqSearch.and(SNAPSHOT_ID, idStateNeqSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
151-
idStateNeqSearch.and(STATE, idStateNeqSearch.entity().getState(), SearchCriteria.Op.NEQ);
152-
idStateNeqSearch.done();
149+
idStateNinSearch = createSearchBuilder();
150+
idStateNinSearch.and(SNAPSHOT_ID, idStateNinSearch.entity().getSnapshotId(), SearchCriteria.Op.EQ);
151+
idStateNinSearch.and(STATE, idStateNinSearch.entity().getState(), SearchCriteria.Op.NOTIN);
152+
idStateNinSearch.done();
153153

154154
snapshotVOSearch = snapshotDao.createSearchBuilder();
155155
snapshotVOSearch.and(VOLUME_ID, snapshotVOSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
@@ -480,15 +480,15 @@ public List<SnapshotDataStoreVO> findBySnapshotId(long snapshotId) {
480480

481481
@Override
482482
public List<SnapshotDataStoreVO> findBySnapshotIdWithNonDestroyedState(long snapshotId) {
483-
SearchCriteria<SnapshotDataStoreVO> sc = idStateNeqSearch.create();
483+
SearchCriteria<SnapshotDataStoreVO> sc = idStateNinSearch.create();
484484
sc.setParameters(SNAPSHOT_ID, snapshotId);
485485
sc.setParameters(STATE, State.Destroyed.name());
486486
return listBy(sc);
487487
}
488488

489489
@Override
490490
public List<SnapshotDataStoreVO> findBySnapshotIdAndNotInDestroyedHiddenState(long snapshotId) {
491-
SearchCriteria<SnapshotDataStoreVO> sc = idStateNeqSearch.create();
491+
SearchCriteria<SnapshotDataStoreVO> sc = idStateNinSearch.create();
492492
sc.setParameters(SNAPSHOT_ID, snapshotId);
493493
sc.setParameters(STATE, State.Destroyed.name(), State.Hidden.name());
494494
return listBy(sc);

test/integration/smoke/test_secondary_storage.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ def test_01_sys_vm_start(self):
136136
'Up',
137137
"Check state of primary storage pools is Up or not"
138138
)
139-
for _ in range(2):
139+
# Poll until all SSVMs are Running, or timeout after 3 minutes
140+
timeout = 180
141+
interval = 15
142+
list_ssvm_response = []
143+
while timeout > 0:
140144
list_ssvm_response = list_ssvms(
141145
self.apiclient,
142146
systemvmtype='secondarystoragevm',
@@ -154,10 +158,12 @@ def test_01_sys_vm_start(self):
154158
"Check list System VMs response"
155159
)
156160

157-
for ssvm in list_ssvm_response:
158-
if ssvm.state != 'Running':
159-
time.sleep(30)
160-
continue
161+
if all(ssvm.state == 'Running' for ssvm in list_ssvm_response):
162+
break
163+
164+
time.sleep(interval)
165+
timeout -= interval
166+
161167
for ssvm in list_ssvm_response:
162168
self.assertEqual(
163169
ssvm.state,

0 commit comments

Comments
 (0)