Flaky Test
不安定なテスト
Flaky Testは、コードを変えていないのに成功したり失敗したりするテストです。タイミングや順番、共有された状態、ランダム要素、他のシステムが原因になることが多いです。
もう一つの例
ブラウザテストが同時に動いて失敗するのは、2つのテストが同じ1つのアカウントを使っているからだよ。それぞれ別のアカウントを使ったり、イベントを待機したりすることで、この競争をなくせるよ。
主な部分
- 01Code or behavior under test
- 02Observable evidence
- 03Coverage, failure, and recovery
以下の場合に使用します
失敗を記録して繰り返す。短時間ブロックされた場合は、所有者を指定して原因を修正します。
以下の場合は使用しないでください
無計画な再試行、恒久的な隔離、サポートされない非難、1回の緑の再実行を修正として扱うことを避けてください。
コードで使用する名前
repetition + seed + timing/order isolation 出荷前に
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 不安定なテスト (Flaky Test)。 User context:ブラウザテストが同時に動いて失敗するのは、2つのテストが同じ1つのアカウントを使っているからだよ。それぞれ別のアカウントを使ったり、イベントを待機したりすることで、この競争をなくせるよ。 Validation approach:不安定なテスト (Flaky Test)。 Why it fits:失敗を記録して繰り返す。短時間ブロックされた場合は、所有者を指定して原因を修正します。 Do not use it when:無計画な再試行、恒久的な隔離、サポートされない非難、1回の緑の再実行を修正として扱うことを避けてください。 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):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Release gate, environment, prepared test data, allowed error, time budget, owner, and flaky-test rule.
このリクエストを確認する
Review how 不安定なテスト (Flaky Test) is used now. Definition: Flaky Testは、コードを変えていないのに成功したり失敗したりするテストです。タイミングや順番、共有された状態、ランダム要素、他のシステムが原因になることが多いです。 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.