Skip to content
Sarj Code Standards

no-flake-masking

Keep test retries disabled and explicit test timeouts within framework defaults.

Why

Organization policy keeps each test attempt visible and uses the framework's default per-test time budget. Diagnose synchronization and setup costs before changing either contract.

Fix

Disable retries and keep per-test timeouts within the documented framework defaults. Review required long-running integration contracts and preserve their justified exact-rule exceptions.

Examples

Before — flagged Do not rerun a failing test
src/sync.test.ts
import { it } from "vitest";
it("syncs", { retry: 2 }, async () => {
await sync.done;
expect(sync.state).toBe("idle");
});
After — preferred Await the signal within the default budget
src/sync.test.ts
import { it } from "vitest";
it("syncs", async () => {
await sync.done;
expect(sync.state).toBe("idle");
});
Before — flagged Do not raise a test's time budget
src/sync.test.ts
import { it } from "vitest";
it("syncs", async () => {
await sync.done;
}, 30_000);
After — preferred A budget below the default does not hide slowness
src/sync.test.ts
import { it } from "vitest";
it("syncs", async () => {
await sync.done;
}, 1000);
Before — flagged Do not retry end-to-end suites in CI
playwright.config.ts
import { defineConfig } from "@playwright/test";
export default defineConfig({ retries: process.env.CI ? 2 : 0 });
After — preferred Run each end-to-end test once
playwright.config.ts
import { defineConfig } from "@playwright/test";
export default defineConfig({ retries: 0 });

References