Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Keep refresh stability browser proof current

pulse-triage[bot]07c2f9ffa04d
diff --git a/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
index 081a2d8213..30213e3216 100644
--- a/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
+++ b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
@@ -105,7 +105,7 @@ async function positionElementNearViewportBottom(
return locator.evaluate((element) => element.getBoundingClientRect().top);
}
-// The drawer tab strip (Overview | History | Discovery) marks the active tab
+// The drawer tab strip marks the active tab
// with aria-selected, so read that instead of panel order.
async function readGuestDrawerActiveTab(detailRow: Locator): Promise<string> {
const buttons = detailRow.locator("[aria-selected]");
@@ -179,7 +179,7 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
}
});
- test("keeps an expanded Proxmox VM on the Discovery tab across workload polling", async ({
+ test("keeps an expanded Proxmox VM on the History tab across workload polling", async ({
page,
}, testInfo) => {
test.skip(
@@ -213,16 +213,19 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await expect(detailRow).toBeVisible();
// The drawer tab strip exposes proper tab roles.
- const discoveryButton = detailRow.getByRole("tab", {
- name: "Discovery",
+ // History is always present and is the tab users reported being reset by
+ // live refreshes. Discovery is optional and must not be a hidden fixture
+ // prerequisite for this polling regression proof.
+ const historyButton = detailRow.getByRole("tab", {
+ name: "History",
exact: true,
});
- await expect(discoveryButton).toBeVisible();
- await discoveryButton.click();
+ await expect(historyButton).toBeVisible();
+ await historyButton.click();
await expect
.poll(() => readGuestDrawerActiveTab(detailRow))
- .toBe("discovery");
+ .toBe("history");
const beforePollScrollTop = await readPrimaryViewportScrollTop(page);
@@ -231,7 +234,7 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await expect(detailRow).toBeVisible();
await expect
.poll(() => readGuestDrawerActiveTab(detailRow), { timeout: 15_000 })
- .toBe("discovery");
+ .toBe("history");
const afterPollScrollTop = await readPrimaryViewportScrollTop(page);
expect(afterPollScrollTop).toBeGreaterThanOrEqual(
@@ -239,7 +242,7 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
);
});
- test("retains LXC rows through warning health projections and removes a confirmed deletion", async ({
+ test("retains LXC rows through warning health refreshes and removes a confirmed deletion", async ({
page,
}, testInfo) => {
test.skip(
@@ -254,15 +257,18 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
let deletionResponses = 0;
let publishDeletion = false;
- // The REST sequence is the contract under test. Prevent live inventory
- // frames from replacing it while polling is exercised.
+ // The Proxmox surface owns a source-scoped canonical resource snapshot.
+ // Intercept that REST sequence and prevent live inventory frames from
+ // replacing it while snapshot refresh is exercised.
await page.routeWebSocket("**/ws*", () => {});
await page.route("**/api/resources?**", async (route) => {
const url = new URL(route.request().url());
if (
url.pathname !== "/api/resources" ||
- url.searchParams.get("type") !== "vm,system-container,app-container,pod"
+ url.searchParams.get("type") !==
+ "agent,vm,system-container,oci-container" ||
+ url.searchParams.get("source") !== "proxmox"
) {
await route.continue();
return;
@@ -318,6 +324,17 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
);
await expect(detailRow).toBeVisible();
+ // The Proxmox surface now reconciles its canonical snapshot from realtime
+ // frames rather than a timer-driven REST poll. Use the same forced
+ // canonical refresh event as an in-app metadata update so this remains a
+ // deterministic snapshot-reconciliation proof with WebSockets blocked.
+ await page.evaluate(() =>
+ window.dispatchEvent(
+ new CustomEvent("pulse:resource-metadata-changed", {
+ detail: { metadataKind: "guest", metadataId: "lab:node-a:102" },
+ }),
+ ),
+ );
await expect
.poll(() => staleProjectionResponses, { timeout: 15_000 })
.toBeGreaterThan(0);
@@ -327,6 +344,13 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await expect(detailRow).toBeVisible();
publishDeletion = true;
+ await page.evaluate(() =>
+ window.dispatchEvent(
+ new CustomEvent("pulse:resource-metadata-changed", {
+ detail: { metadataKind: "guest", metadataId: "lab:node-a:102" },
+ }),
+ ),
+ );
await expect
.poll(() => deletionResponses, { timeout: 15_000 })
.toBeGreaterThan(0);