Flaky Test
Teste instável
Um Flaky Test pode passar ou falhar sem nenhuma mudança no código. Tempo, ordem, estado compartilhado, aleatoriedade ou sistemas externos costumam causar isso.
Outro exemplo
Um teste de navegador falha em paralelo porque dois workers compartilham a mesma conta. Fixtures exclusivos e espera por eventos eliminam a disputa.
Partes principais
- 01Code or behavior under test
- 02Observable evidence
- 03Coverage, failure, and recovery
Use-o quando
Registre e repita a falha. Se estiver brevemente bloqueado, nomeie um responsável e corrija a causa da mudança.
Não o use quando
Evite tentar de novo sem ver, quarentena permanente, jogar a culpa no lugar errado e achar que um teste verde soluciona o problema.
Nome usado no código
repetition + seed + timing/order isolation Antes de lançar
Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule.
Outcome: Complete the task with Teste instável (Flaky Test). User context: Um teste de navegador falha em paralelo porque dois workers compartilham a mesma conta. Fixtures exclusivos e espera por eventos eliminam a disputa. Validation approach: Teste instável (Flaky Test). Why it fits: Registre e repita a falha. Se estiver brevemente bloqueado, nomeie um responsável e corrija a causa da mudança. Do not use it when: Evite tentar de novo sem ver, quarentena permanente, jogar a culpa no lugar errado e achar que um teste verde soluciona o problema. Test requirements: Name the system and test environment. Define prepared test data, other inputs, and the result you can observe. Include failure and edge cases, allowed error, isolation, and cleanup. Test operations: Make failures easy to diagnose. Control random or changing inputs. Name an owner. Keep the test fast and simple enough for its release gate. Acceptance criteria: The test fails for the known bug and passes after the fix. It repeats in the target environment, gives useful evidence, and does not expose or change unrelated data. Evidence and limits (evidence boundary): Nenhum padrão oficial único controla todo o termo. Seu significado pode mudar entre equipes, plataformas ou frameworks. Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
Conferir este pedido
Review how Teste instável (Flaky Test) is used now. Definition: Um Flaky Test pode passar ou falhar sem nenhuma mudança no código. Tempo, ordem, estado compartilhado, aleatoriedade ou sistemas externos costumam causar isso. Release checks: Check the environment and prepared test data (fixture). Define a result you can observe, failure and edge cases, isolation, stable inputs, useful error details, and cleanup. Set a time budget, owner, and flaky-test rule. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.