fix(e2e): skip supersync tests when server unavailable

Move health check into testRunId fixture so all supersync tests
automatically skip when the server isn't running. Previously, tests
would fail with ECONNREFUSED and count toward the 5-failure limit,
interrupting the entire test run.
This commit is contained in:
Johannes Millan 2026-01-05 11:50:51 +01:00
parent e046eb9100
commit 2e890fc0d6

View file

@ -44,8 +44,22 @@ export const test = base.extend<SuperSyncFixtures>({
/**
* Generate a unique test run ID for this test.
* Used to isolate test data between parallel test runs.
* Also checks server health and skips test if server unavailable.
*/
testRunId: async ({}, use, testInfo) => {
// Check server health once per worker
if (serverHealthyCache === null) {
serverHealthyCache = await isServerHealthy();
if (!serverHealthyCache) {
console.warn(
'SuperSync server not healthy at http://localhost:1901 - skipping tests',
);
}
}
// Skip if server not healthy
testInfo.skip(!serverHealthyCache, 'SuperSync server not running');
const id = generateTestRunId(testInfo.workerIndex);
await use(id);
},