Commit 480b2a7
authored
CMP-3895: Improve rescan wait logic for e2e tests (#835)
The e2e tests have been failing with what appears to be a transient race
condition when a test rescans the environment, then waits for the suite
or scan to get to a terminal state, like DONE and NON-COMPLIANT.
The problem is that the test does something to initiate a rescan
(deleting a suite, creating a scan setting binding, etc), and then it
immediately starts looking for the ComplianceSuite status to see if it's
done.
In the case of rescans, the data from the last scan might still be
lingering around and if the test is faster than the reconcile loops of
the ComplianceScan controller, it could breeze through the wait logic
and think the scan is already complete.
This commit attempts to address that by using the rescan annotation. By
using the annotation to rescan (instead of deleting a scan suite
entirely), we can update the function that polls the suite status to
also check for the annotations. If the wait function sees the
annotation, it should continue polling since that's a clear signal that
the ComplianceScan controller has not updated the scan data or reset the
states back to PENDING. If none of the scans in the suite have the
annotation, then it's probably safe to move forward and assume the
status for each scan is updated and accurate, since the ComplianceScan
controller will remove the rescan annotation when it restarts the scan.1 parent 1276cdd commit 480b2a7
2 files changed
+96
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1176 | 1176 | | |
1177 | 1177 | | |
1178 | 1178 | | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
1179 | 1213 | | |
1180 | 1214 | | |
1181 | 1215 | | |
| |||
1228 | 1262 | | |
1229 | 1263 | | |
1230 | 1264 | | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1231 | 1321 | | |
1232 | 1322 | | |
1233 | 1323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2546 | 2546 | | |
2547 | 2547 | | |
2548 | 2548 | | |
2549 | | - | |
2550 | | - | |
| 2549 | + | |
| 2550 | + | |
2551 | 2551 | | |
2552 | | - | |
| 2552 | + | |
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
| |||
3459 | 3459 | | |
3460 | 3460 | | |
3461 | 3461 | | |
3462 | | - | |
3463 | | - | |
| 3462 | + | |
| 3463 | + | |
3464 | 3464 | | |
3465 | | - | |
| 3465 | + | |
3466 | 3466 | | |
3467 | 3467 | | |
3468 | 3468 | | |
| |||
0 commit comments