A platform for community discussion. Free, open, simple.
DEV: Remove flaky tests report when there are too many failures (#25031)
Alan Guo Xiang Tancfec408bc13a
diff --git a/lib/turbo_tests/flaky/manager.rb b/lib/turbo_tests/flaky/manager.rbindex d1efd4f5b9a..c71e5146dcd 100644--- a/lib/turbo_tests/flaky/manager.rb+++ b/lib/turbo_tests/flaky/manager.rb@@ -11,6 +11,10 @@ module TurboTests.map { |failed_example| failed_example["location_rerun_argument"] }end+ def self.remove_flaky_tests+ File.delete(PATH) if File.exist?(PATH)+ end+# This method should only be called by a formatter registered with `TurboTests::Runner` and logs the failed examples# to `PATH`. See `FailedExample#to_h` for the details of each example that is logged.#diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rbindex d04b3b44c33..b4de43eed84 100644--- a/lib/turbo_tests/runner.rb+++ b/lib/turbo_tests/runner.rb@@ -103,6 +103,7 @@ module TurboTestsreturn rerun_failed_examples(@reporter.failed_examples)elseSTDOUT.puts "Retry and log flaky tests was enabled but ignored because there are more than #{retry_failed_examples_threshold} failures."+ Flaky::Manager.remove_flaky_testsendend