From 016d223673c0f1f9e52ca8762fc0c4fc79cfafcc Mon Sep 17 00:00:00 2001 From: CieanYau Date: Sat, 7 Nov 2026 04:18:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=9A=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E6=A0=B7=E6=9C=AC=E7=9A=84=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=B9=B6=E5=87=86=E7=A1=AE=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=9B=B6=E5=80=BC=E9=AA=8C=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/review-instance-metrics.e2e.test.mjs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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, + }; }), ); }