From ee75868c58831d9842d451f3e6be9c4fc6c90d8d Mon Sep 17 00:00:00 2001 From: Vamsi Karthik R Date: Wed, 4 Nov 2026 09:55:52 +0530 Subject: [PATCH] test(dashboards): stop waiting for streamed PromQL responses to finish #16126 dropped the event-stream guard from applyAndWaitForPromQLQuery that #15735 added, so on alpha1 the helper again hangs to the 5-minute test timeout when the query_range stream never reports finished. Restore the guard, and make promqlSampleValues re-fetch the range instead of reading the browser's body, which an aborted stream does not keep. --- .../pages/dashboardPages/dashboard-panel-actions.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/ui-testing/pages/dashboardPages/dashboard-panel-actions.js b/tests/ui-testing/pages/dashboardPages/dashboard-panel-actions.js index 616db91472..a2bfb28355 100644 --- a/tests/ui-testing/pages/dashboardPages/dashboard-panel-actions.js +++ b/tests/ui-testing/pages/dashboardPages/dashboard-panel-actions.js @@ -363,7 +363,10 @@ export default class DashboardactionPage { ); await this.applyDashboardBtn(); const response = await promqlResponse; - await response.finished(); + // A streamed (text/event-stream) response may never report finished; waitForChartToRender covers completion. + if (!(await response.headerValue("content-type"))?.includes("text/event-stream")) { + await response.finished(); + } await this.waitForChartToRender(); return response; } @@ -384,9 +387,10 @@ export default class DashboardactionPage { ); } - /** Sorted sample values of every series in a finished PromQL query_range event-stream response. */ + /** Sorted sample values of every series in a PromQL query_range event-stream response. */ async promqlSampleValues(response) { - return (await response.text()) + // The browser can abort the stream after the last event and keep no body, so fetch the same absolute range again. + return (await (await this.page.request.get(response.url())).text()) .split("\n") .filter((line) => line.startsWith("data: ")) .map((line) => {