Skip to content

Commit cc77a6d

Browse files
authored
chore(test): increase robustness in prune containers e2e test (podman-desktop#12922)
Signed-off-by: Vladimir Lazar <vlazar@redhat.com>
1 parent 0f4cbf1 commit cc77a6d

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

tests/playwright/src/specs/container-smoke.spec.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,29 +239,32 @@ test.describe.serial('Verification of container creation workflow', { tag: '@smo
239239
});
240240

241241
test('Prune containers', async ({ page, navigationBar }) => {
242-
test.setTimeout(200_000);
242+
test.setTimeout(210_000);
243+
244+
const stopStatusArray = [ContainerState.Stopped, ContainerState.Exited];
245+
const stopStatusRegex = new RegExp(`${stopStatusArray.join('|')}`);
243246

244247
//Start 3 containers
245248
for (const container of containerList) {
246249
const images = await navigationBar.openImages();
247250
const containersPage = await images.startContainerWithImage(imageToPull, container, containerStartParams);
248251
await playExpect(containersPage.heading).toBeVisible();
249252
await playExpect
250-
.poll(async () => await containersPage.containerExists(container), { timeout: 15_000 })
253+
.poll(async () => await containersPage.containerExists(container), { timeout: 30_000 })
251254
.toBeTruthy();
252255
}
253256
//Stop a container, prune, and repeat
254257
for (const container of containerList) {
255258
let containersPage = new ContainersPage(page);
256259
const containersDetails = await containersPage.stopContainerFromDetails(container);
257260
await playExpect
258-
.poll(async () => await containersDetails.getState(), { timeout: 20_000 })
259-
.toBe(ContainerState.Exited);
261+
.poll(async () => await containersDetails.getState(), { timeout: 60_000 })
262+
.toMatch(stopStatusRegex);
260263
containersPage = await navigationBar.openContainers();
261264
await playExpect(containersPage.heading).toBeVisible();
262265
await containersPage.pruneContainers();
263266
await playExpect
264-
.poll(async () => await containersPage.containerExists(container), { timeout: 15_000 })
267+
.poll(async () => await containersPage.containerExists(container), { timeout: 30_000 })
265268
.toBeFalsy();
266269
}
267270

@@ -271,12 +274,12 @@ test.describe.serial('Verification of container creation workflow', { tag: '@smo
271274
const containersPage = await images.startContainerWithImage(imageToPull, container, containerStartParams);
272275
await playExpect(containersPage.heading).toBeVisible();
273276
await playExpect
274-
.poll(async () => await containersPage.containerExists(container), { timeout: 15_000 })
277+
.poll(async () => await containersPage.containerExists(container), { timeout: 30_000 })
275278
.toBeTruthy();
276279
const containersDetails = await containersPage.stopContainerFromDetails(container);
277280
await playExpect
278-
.poll(async () => await containersDetails.getState(), { timeout: 20_000 })
279-
.toBe(ContainerState.Exited);
281+
.poll(async () => await containersDetails.getState(), { timeout: 60_000 })
282+
.toMatch(stopStatusRegex);
280283
}
281284
//Prune the 3 stopped containers at the same time
282285
const containersPage = await navigationBar.openContainers();

0 commit comments

Comments
 (0)