From e1ef45f5e0acb316d43de354295d184dd4b713cb Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Tue, 16 Jun 2026 15:19:19 +0200 Subject: [PATCH] chore: wait for apiReady before e2e assertions (#30928) --- tests/evcc.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/evcc.ts b/tests/evcc.ts index 8e54c298d..5ce51b8ca 100644 --- a/tests/evcc.ts +++ b/tests/evcc.ts @@ -130,7 +130,10 @@ async function _start(config?: string, flags: string | string[] = []) { steamLog.end(); }); try { - await waitOn({ resources: [baseUrl()], log: LOG_ENABLED, timeout: 90000 }); + // wait for apiReady so tests don't race a half-started backend + const jq = encodeURIComponent(".apiReady|select(.)"); + const ready = `${baseUrl().replace(/^http/, "http-get")}/api/state?jq=${jq}`; + await waitOn({ resources: [ready], log: LOG_ENABLED, timeout: 90000 }); } catch (error) { instance.kill("SIGKILL"); console.error(logPrefix(), `evcc startup failed: ${error}`);