Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

reliable-tests

/reliable-tests

Diagnozuje, naprawia i zapobiega niestabilnym testom, głównie przez czasy, wspólny stan i różnice Windows.

Repozytorium
tds-factory ↗
Licencja
MIT
Ostatnia zmiana repozytorium
04.11.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Diagnozuje, naprawia i zapobiega niestabilnym testom, głównie przez czasy, wspólny stan i różnice Windows.

Oryginalny opis (EN)

Diagnose, fix and prevent flaky tests, mostly timing, shared state and Windows differences. Use when a test passes and fails at random, fails only on one platform or in CI, when writing a test that waits, spawns a process, uses a port, a temp folder or timestamps, or when asked to make tests more reliable.

Jak działa

  1. Diagnose
  2. Fix
  3. Verify
Sekcje z nagłówków SKILL.md, w oryginale · 28 linii, 339 słów
Podgląd SKILL.md
---
name: reliable-tests
description: 'Diagnose, fix and prevent flaky tests, mostly timing, shared state and Windows differences. Use when a test passes and fails at random, fails only on one platform or in CI, when writing a test that waits, spawns a process, uses a port, a temp folder or timestamps, or when asked to make tests more reliable.'
---

# Reliable tests

A flaky test fails without a change in the code. Treat it as a bug in the test (or in the code's missing signal), never as bad luck. The rules live in the guide `.github/instructions/reliable-tests.instructions.md`; read it first. This Skill is the procedure.

## Diagnose

1. **Reproduce.** Run the file in a loop (`for i in $(seq 30); do node --test test/<file>.test.js || break; done`), then again under CPU load (run several copies at once) and with `--test-concurrency=1`. If the failure only shows on Windows, run the same loop in PowerShell 7 and Git for Windows. No reproduction yet is no fix yet: keep trying before you change code.
2. **Read the failure.** Take the first assertion that failed, not the last. Note the time it took and what ran before it.
3. **Classify the cause.** One of:
   - **Timing**: a fixed sleep, a short time budget, an assertion on elapsed time or timestamp order.
   - **Shared state**: a fixed port, path, file name, environment variable, or a leftover from another test.
   - **Platform**: path separators, line endings, locked files, signals, symlinks, slow process start.
   - **Ordering**: the test needs an earlier test, or two tests race on a file.
4. **State the cause** in one sentence before fixing it.

## Fix

- Timing: replace the sleep with `waitUntil` (`test/wait-until.js`) on a condition or an event. For "nothing happened", wait for a signal that proves the other side had its chance.
- Shared state: a port 0, a temp folder per test (`test/git-repo.js`), `t.after` cleanup.
- Platform: `path.join`, `rmSync` with `maxRetries`, a skip with a reason where the platform cannot do it.
- Ordering: make the test build its own setup.
- Do not add a retry, `skip` the test or raise a timeout to make it green, unless you can say why the original budget was wrong.

## Verify

Run the loop from step 1 again: 30 passes in a row and the Verify command. Name the cause and the fix in the commit message.

Wersje

W bazie nie ma innych skilli o nazwie reliable-tests.

Migawka bazy z 13.11.2026 · wersja paczki 729c9786cc87 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100flaky-test-diagnosis
    Diagnozuje niestabilne testy przez powtarzanie, klasyfikuje przyczynę, czyli czas, kolejność, stan wspólny lub środowisko, i naprawia albo izoluje.
  • 100flaky-tests
    Diagnozuje i zapobiega niestabilnym testom Biloba w TypeScript i Vitest: zbędne pętle ponowień, optymistyczny UI, asynchroniczny layout, handlery sieciowe i UI sterowany timerami przez zegar strony.
  • 100fix-flaky-tests
    Bada i naprawia niestabilne testy w dowolnym frameworku i systemie CI: wykrywa framework oraz dostawcę CI i stosuje pasujące wzorce klasyfikacji oraz poprawek.
  • 100flaky-test-killer
    Szuka przyczyny testu niestabilnego i naprawia ją, nie dokładając ponowień, czekania ani większych limitów czasu, z pomiarami przed i po.
  • 100flaky-test-reproduction
    Zamienia test niestabilny w deterministyczne odtworzenie przed poprawką, zwłaszcza w testach asynchronicznych i współbieżnych w Rust.
  • 100fixing-flaky-e2e-tests
    Diagnozuje i naprawia niestabilne testy e2e Playwright: sporadyczne porażki, błędy limitów czasu, niezgodności snapshotów i różnice między przeglądarkami.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.