diff --git a/tests/review-instance-metrics.e2e.test.mjs b/tests/review-instance-metrics.e2e.test.mjs index c693d65..e93625e 100644 --- a/tests/review-instance-metrics.e2e.test.mjs +++ b/tests/review-instance-metrics.e2e.test.mjs @@ -13,7 +13,7 @@ import { async function instanceBoundary( page, - { module = "mf_cloud", value = 50, time = 1793836800 } = {}, + { module = "mf_cloud", value = 50, time } = {}, ) { const state = { value, quotes: [], chartReads: 0 }; const times = [ @@ -21,7 +21,11 @@ async function instanceBoundary( "2026-11-06 08:00:00", "2026-11-07 08:00:00", ]; - const epoch = time; + // 秒级接口按浏览器本地08:00造样本,与字符串时间接口一致,不依赖执行机时区。 + const epoch = + time === undefined + ? await page.evaluate(() => new Date(2026, 10, 5, 8).getTime() / 1000) + : time; await page.context().route(`${backendOrigin}/console/v1/**`, (route) => { const request = route.request(); const url = new URL(request.url()); @@ -266,7 +270,7 @@ test( for (const module of ["mf_cloud", "remf_finance", "kky_ecs"]) { test( - `real zero ${module} measurements remain visible in overview and monitor`, + `real zero ${module} CPU remains visible alongside other metric charts`, { timeout: 30000 }, (t) => scenario(t, {}, async (page) => { @@ -290,7 +294,13 @@ for (const module of ["mf_cloud", "remf_finance", "kky_ecs"]) { page.locator(".mon .chart-viewport").first(), "0%", ); - return { module, observedZeroRings: 2, observedZeroCharts: 4, tooltip }; + return { + module, + observedZeroRings: 2, + renderedMetricCharts: 4, + observedCpuZero: true, + tooltip, + }; }), ); }