chore: wait for apiReady before e2e assertions (#30928)

This commit is contained in:
Michael Geers 2026-06-16 15:19:19 +02:00 • committed by GitHub
parent 4e40218a65
commit e1ef45f5e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}`);