Skip to content

Commit

Permalink
chore(test): fix flaky volume delete behaviour (#10347)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Lazar <[email protected]>
  • Loading branch information
cbr7 authored Dec 13, 2024
1 parent e9eb093 commit 2722e15
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions tests/playwright/src/specs/volume-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import { waitForPodmanMachineStartup } from '../utility/wait';
const imageToPull = 'quay.io/centos-bootc/bootc-image-builder';
const imageTag = 'latest';
const containerToRun = 'bootc-image-builder';
const containerStartParams: ContainerInteractiveParams = { attachTerminal: false };
const containerStartParams: ContainerInteractiveParams = {
attachTerminal: false,
};

test.beforeAll(async ({ runner, welcomePage, page }) => {
runner.setVideoAndTraceName('volume-e2e');
Expand All @@ -46,7 +48,9 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
const createVolumePage = await volumesPage.openCreateVolumePage(volumeName);
volumesPage = await createVolumePage.createVolume(volumeName);
await playExpect
.poll(async () => await volumesPage.waitForVolumeExists(volumeName), { timeout: 25_000 })
.poll(async () => await volumesPage.waitForVolumeExists(volumeName), {
timeout: 25_000,
})
.toBeTruthy();
});

Expand All @@ -73,7 +77,11 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
const volumeRow = await volumesPage.getVolumeRowByName(volumeName);
playExpect(volumeRow).not.toBeUndefined();
volumesPage = await volumesPage.deleteVolume(volumeName);
await playExpect.poll(async () => await volumesPage.waitForVolumeDelete(volumeName)).toBeTruthy();
await playExpect
.poll(async () => await volumesPage.waitForVolumeDelete(volumeName), {
timeout: 35_000,
})
.toBeTruthy();
});

test('Delete volume through details page', async ({ navigationBar }) => {
Expand All @@ -84,7 +92,11 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
const createVolumePage = await volumesPage.openCreateVolumePage(volumeName);
volumesPage = await createVolumePage.createVolume(volumeName);

await playExpect.poll(async () => await volumesPage.waitForVolumeExists(volumeName)).toBeTruthy();
await playExpect
.poll(async () => await volumesPage.waitForVolumeExists(volumeName), {
timeout: 35_000,
})
.toBeTruthy();

//delete it from the details page
volumesPage = await navigationBar.openVolumes();
Expand All @@ -95,7 +107,11 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
const volumeDetails = await volumesPage.openVolumeDetails(volumeName);
volumesPage = await volumeDetails.deleteVolume();

await playExpect.poll(async () => await volumesPage.waitForVolumeDelete(volumeName)).toBeTruthy();
await playExpect
.poll(async () => await volumesPage.waitForVolumeDelete(volumeName), {
timeout: 35_000,
})
.toBeTruthy();
});

test('Create volumes from bootc-image-builder', async ({ navigationBar }) => {
Expand Down Expand Up @@ -132,7 +148,9 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
let containers = await runImage.startContainer(containerToRun, containerStartParams);
await playExpect(containers.header).toBeVisible();
await playExpect
.poll(async () => await containers.containerExists(containerToRun), { timeout: 60_000 })
.poll(async () => await containers.containerExists(containerToRun), {
timeout: 60_000,
})
.toBeTruthy();
await containers.startContainer(containerToRun);

Expand All @@ -152,7 +170,9 @@ test.describe.serial('Volume workflow verification', { tag: '@smoke' }, () => {
const containersPage = await containers.deleteContainer(containerToRun);
await playExpect(containersPage.heading).toBeVisible();
await playExpect
.poll(async () => await containersPage.containerExists(containerToRun), { timeout: 30_000 })
.poll(async () => await containersPage.containerExists(containerToRun), {
timeout: 30_000,
})
.toBeFalsy();

//prune unused volumes
Expand Down

0 comments on commit 2722e15

Please sign in to comment.