2019-06-21 09:33:41 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
module TurboTests
|
|
|
|
class Runner
|
2019-06-27 22:48:38 +08:00
|
|
|
def self.run(opts = {})
|
|
|
|
files = opts[:files]
|
|
|
|
formatters = opts[:formatters]
|
2023-05-17 17:22:31 +08:00
|
|
|
seed = opts[:seed]
|
2019-06-27 22:48:38 +08:00
|
|
|
start_time = opts.fetch(:start_time) { Time.now }
|
|
|
|
verbose = opts.fetch(:verbose, false)
|
2019-10-09 22:40:06 +08:00
|
|
|
fail_fast = opts.fetch(:fail_fast, nil)
|
2023-02-23 05:47:11 +08:00
|
|
|
use_runtime_info = opts.fetch(:use_runtime_info, false)
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
retry_and_log_flaky_tests = opts.fetch(:retry_and_log_flaky_tests, false)
|
2019-06-27 22:48:38 +08:00
|
|
|
|
2023-05-17 17:22:31 +08:00
|
|
|
STDOUT.puts "VERBOSE" if verbose
|
2019-06-27 22:48:38 +08:00
|
|
|
|
2023-05-30 09:52:46 +08:00
|
|
|
reporter =
|
|
|
|
Reporter.from_config(
|
|
|
|
formatters,
|
|
|
|
start_time,
|
|
|
|
max_timings_count: opts[:profile_print_slowest_examples_count],
|
|
|
|
)
|
2019-06-21 08:59:01 +08:00
|
|
|
|
2023-05-13 00:22:15 +08:00
|
|
|
if ENV["GITHUB_ACTIONS"]
|
|
|
|
RSpec.configure do |config|
|
|
|
|
# Enable color output in GitHub Actions
|
|
|
|
# This eventually will be `config.color_mode = :on` in RSpec 4?
|
|
|
|
config.tty = true
|
|
|
|
config.color = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-02-23 05:47:11 +08:00
|
|
|
new(
|
|
|
|
reporter: reporter,
|
|
|
|
files: files,
|
|
|
|
verbose: verbose,
|
|
|
|
fail_fast: fail_fast,
|
|
|
|
use_runtime_info: use_runtime_info,
|
2023-05-17 17:22:31 +08:00
|
|
|
seed: seed,
|
2023-05-30 09:52:46 +08:00
|
|
|
profile: opts[:profile],
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
retry_and_log_flaky_tests: retry_and_log_flaky_tests,
|
2023-02-23 05:47:11 +08:00
|
|
|
).run
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.default_spec_folders
|
|
|
|
# We do not want to include system specs by default, they are quite slow.
|
|
|
|
Dir
|
|
|
|
.entries("#{Rails.root}/spec")
|
|
|
|
.reject { |entry| !File.directory?("spec/#{entry}") || %w[.. . system].include?(entry) }
|
|
|
|
.map { |entry| "spec/#{entry}" }
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
|
2019-06-27 22:48:38 +08:00
|
|
|
def initialize(opts)
|
|
|
|
@reporter = opts[:reporter]
|
|
|
|
@files = opts[:files]
|
|
|
|
@verbose = opts[:verbose]
|
2019-10-09 22:40:06 +08:00
|
|
|
@fail_fast = opts[:fail_fast]
|
2023-02-23 05:47:11 +08:00
|
|
|
@use_runtime_info = opts[:use_runtime_info]
|
2023-05-17 17:22:31 +08:00
|
|
|
@seed = opts[:seed]
|
2023-05-30 09:52:46 +08:00
|
|
|
@profile = opts[:profile]
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
@retry_and_log_flaky_tests = opts[:retry_and_log_flaky_tests]
|
2019-10-09 22:40:06 +08:00
|
|
|
@failure_count = 0
|
2019-06-27 22:48:38 +08:00
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
@messages = Queue.new
|
|
|
|
@threads = []
|
2020-06-23 11:45:18 +08:00
|
|
|
@error = false
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
2019-06-27 23:41:09 +08:00
|
|
|
check_for_migrations
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
@num_processes = ParallelTests.determine_number_of_processes(nil)
|
2019-08-30 23:25:17 +08:00
|
|
|
|
|
|
|
group_opts = {}
|
2023-05-17 17:22:31 +08:00
|
|
|
group_opts[:runtime_log] = "tmp/turbo_rspec_runtime.log" if @use_runtime_info
|
2019-06-21 08:59:01 +08:00
|
|
|
|
|
|
|
tests_in_groups =
|
|
|
|
ParallelTests::RSpec::Runner.tests_in_groups(@files, @num_processes, **group_opts)
|
|
|
|
|
|
|
|
setup_tmp_dir
|
|
|
|
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
@reporter.add_formatter(Flaky::FailuresLoggerFormatter.new) if @retry_and_log_flaky_tests
|
|
|
|
|
2023-02-23 05:47:11 +08:00
|
|
|
subprocess_opts = { record_runtime: @use_runtime_info }
|
2019-08-30 23:25:17 +08:00
|
|
|
|
|
|
|
start_multisite_subprocess(@files, **subprocess_opts)
|
2019-08-29 17:56:43 +08:00
|
|
|
|
|
|
|
tests_in_groups.each_with_index do |tests, process_id|
|
2019-08-30 23:25:17 +08:00
|
|
|
start_regular_subprocess(tests, process_id + 1, **subprocess_opts)
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
|
2024-04-03 17:54:55 +08:00
|
|
|
@reporter.start
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
handle_messages
|
|
|
|
|
|
|
|
@reporter.finish
|
|
|
|
|
|
|
|
@threads.each(&:join)
|
2019-07-09 15:51:23 +08:00
|
|
|
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
if @retry_and_log_flaky_tests && @reporter.failed_examples.present?
|
|
|
|
retry_failed_examples_threshold = 10
|
|
|
|
|
|
|
|
if @reporter.failed_examples.length <= retry_failed_examples_threshold
|
|
|
|
STDOUT.puts "Retrying failed examples and logging flaky tests..."
|
|
|
|
return rerun_failed_examples(@reporter.failed_examples)
|
|
|
|
else
|
|
|
|
STDOUT.puts "Retry and log flaky tests was enabled but ignored because there are more than #{retry_failed_examples_threshold} failures."
|
2023-12-26 09:23:17 +08:00
|
|
|
Flaky::Manager.remove_flaky_tests
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-23 11:45:18 +08:00
|
|
|
@reporter.failed_examples.empty? && !@error
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
2019-06-27 23:41:09 +08:00
|
|
|
def check_for_migrations
|
|
|
|
config =
|
|
|
|
ActiveRecord::Base
|
2021-04-21 17:36:32 +08:00
|
|
|
.configurations
|
|
|
|
.find_db_config("test")
|
|
|
|
.configuration_hash
|
2019-06-27 23:41:09 +08:00
|
|
|
.merge("database" => "discourse_test_1")
|
|
|
|
|
2019-12-17 03:11:55 +08:00
|
|
|
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = %w[db/migrate db/post_migrate]
|
2019-10-02 15:05:47 +08:00
|
|
|
|
2020-06-23 17:12:31 +08:00
|
|
|
conn = ActiveRecord::Base.establish_connection(config).connection
|
|
|
|
|
2019-06-27 23:41:09 +08:00
|
|
|
begin
|
|
|
|
ActiveRecord::Migration.check_pending!(conn)
|
|
|
|
rescue ActiveRecord::PendingMigrationError
|
|
|
|
puts "There are pending migrations, run rake parallel:migrate"
|
|
|
|
exit 1
|
2020-06-23 11:45:18 +08:00
|
|
|
ensure
|
2020-06-23 17:12:31 +08:00
|
|
|
conn.close
|
2019-06-27 23:41:09 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
def setup_tmp_dir
|
|
|
|
begin
|
|
|
|
FileUtils.rm_r("tmp/test-pipes")
|
|
|
|
rescue Errno::ENOENT
|
|
|
|
end
|
|
|
|
|
|
|
|
FileUtils.mkdir_p("tmp/test-pipes/")
|
|
|
|
end
|
|
|
|
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
def rerun_failed_examples(failed_examples)
|
|
|
|
command = [
|
|
|
|
"bundle",
|
|
|
|
"exec",
|
|
|
|
"rspec",
|
|
|
|
"--format",
|
|
|
|
"documentation",
|
|
|
|
"--format",
|
|
|
|
"TurboTests::Flaky::FlakyDetectorFormatter",
|
|
|
|
*Flaky::Manager.potential_flaky_tests,
|
|
|
|
]
|
|
|
|
|
|
|
|
system(*command)
|
|
|
|
end
|
|
|
|
|
2019-08-30 23:25:17 +08:00
|
|
|
def start_multisite_subprocess(tests, **opts)
|
2019-08-29 17:56:43 +08:00
|
|
|
start_subprocess({}, %w[--tag type:multisite], tests, "multisite", **opts)
|
|
|
|
end
|
|
|
|
|
2019-08-30 23:25:17 +08:00
|
|
|
def start_regular_subprocess(tests, process_id, **opts)
|
2019-08-29 17:56:43 +08:00
|
|
|
start_subprocess(
|
|
|
|
{ "TEST_ENV_NUMBER" => process_id.to_s },
|
|
|
|
%w[--tag ~type:multisite],
|
|
|
|
tests,
|
2019-08-30 23:25:17 +08:00
|
|
|
process_id,
|
|
|
|
**opts,
|
2019-08-29 17:56:43 +08:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-08-30 23:25:17 +08:00
|
|
|
def start_subprocess(env, extra_args, tests, process_id, record_runtime:)
|
2019-06-21 08:59:01 +08:00
|
|
|
if tests.empty?
|
2019-08-29 17:56:43 +08:00
|
|
|
@messages << { type: "exit", process_id: process_id }
|
2019-06-21 08:59:01 +08:00
|
|
|
else
|
2019-08-29 17:56:43 +08:00
|
|
|
tmp_filename = "tmp/test-pipes/subprocess-#{process_id}"
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
begin
|
2019-08-29 17:56:43 +08:00
|
|
|
File.mkfifo(tmp_filename)
|
2019-06-21 08:59:01 +08:00
|
|
|
rescue Errno::EEXIST
|
|
|
|
end
|
|
|
|
|
2019-08-29 17:56:43 +08:00
|
|
|
env["RSPEC_SILENCE_FILTER_ANNOUNCEMENTS"] = "1"
|
|
|
|
|
2019-08-30 23:25:17 +08:00
|
|
|
record_runtime_options =
|
|
|
|
if record_runtime
|
|
|
|
%w[--format ParallelTests::RSpec::RuntimeLogger --out tmp/turbo_rspec_runtime.log]
|
|
|
|
else
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
2019-06-27 22:48:38 +08:00
|
|
|
command = [
|
|
|
|
"bundle",
|
|
|
|
"exec",
|
|
|
|
"rspec",
|
2019-08-29 17:56:43 +08:00
|
|
|
*extra_args,
|
2023-05-17 17:22:31 +08:00
|
|
|
"--order",
|
|
|
|
"random:#{@seed}",
|
2019-08-29 17:56:43 +08:00
|
|
|
"--format",
|
|
|
|
"TurboTests::JsonRowsFormatter",
|
|
|
|
"--out",
|
|
|
|
tmp_filename,
|
2019-08-30 23:25:17 +08:00
|
|
|
*record_runtime_options,
|
2019-06-27 22:48:38 +08:00
|
|
|
*tests,
|
|
|
|
]
|
|
|
|
|
2023-05-30 09:52:46 +08:00
|
|
|
env["DISCOURSE_RSPEC_PROFILE_EACH_EXAMPLE"] = "1" if @profile
|
|
|
|
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
command_string = [env.map { |k, v| "#{k}=#{v}" }.join(" "), command.join(" ")].join(" ")
|
2019-06-27 22:48:38 +08:00
|
|
|
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
if @verbose
|
2023-05-17 17:22:31 +08:00
|
|
|
STDOUT.puts "::group::[#{process_id}] Run RSpec" if ENV["GITHUB_ACTIONS"]
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
STDOUT.puts "Process #{process_id}: #{command_string}"
|
2023-05-17 17:22:31 +08:00
|
|
|
STDOUT.puts "::endgroup::" if ENV["GITHUB_ACTIONS"]
|
2019-06-27 22:48:38 +08:00
|
|
|
end
|
|
|
|
|
2020-06-23 11:45:18 +08:00
|
|
|
stdin, stdout, stderr, wait_thr = Open3.popen3(env, *command)
|
|
|
|
stdin.close
|
2019-06-21 08:59:01 +08:00
|
|
|
|
|
|
|
@threads << Thread.new do
|
2019-08-29 17:56:43 +08:00
|
|
|
File.open(tmp_filename) do |fd|
|
2019-06-21 08:59:01 +08:00
|
|
|
fd.each_line do |line|
|
|
|
|
message = JSON.parse(line)
|
|
|
|
message = message.symbolize_keys
|
2019-08-29 17:56:43 +08:00
|
|
|
message[:process_id] = process_id
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
message[:command_string] = command_string
|
2019-06-21 08:59:01 +08:00
|
|
|
@messages << message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-08-29 17:56:43 +08:00
|
|
|
@messages << { type: "exit", process_id: process_id }
|
2023-01-09 20:10:19 +08:00
|
|
|
end
|
|
|
|
|
2020-06-23 13:34:58 +08:00
|
|
|
@threads << start_copy_thread(stdout, STDOUT)
|
|
|
|
@threads << start_copy_thread(stderr, STDERR)
|
2020-06-23 11:45:18 +08:00
|
|
|
|
|
|
|
@threads << Thread.new { @messages << { type: "error" } if wait_thr.value.exitstatus != 0 }
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_copy_thread(src, dst)
|
|
|
|
Thread.new do
|
|
|
|
while true
|
|
|
|
begin
|
|
|
|
msg = src.readpartial(4096)
|
|
|
|
rescue EOFError
|
2020-06-23 11:45:18 +08:00
|
|
|
src.close
|
2019-06-21 08:59:01 +08:00
|
|
|
break
|
|
|
|
else
|
|
|
|
dst.write(msg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def handle_messages
|
|
|
|
exited = 0
|
|
|
|
|
|
|
|
begin
|
|
|
|
while true
|
|
|
|
message = @messages.pop
|
|
|
|
case message[:type]
|
|
|
|
when "example_passed"
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
example =
|
|
|
|
FakeExample.from_obj(
|
|
|
|
message[:example],
|
|
|
|
process_id: message[:process_id],
|
|
|
|
command_string: message[:command_string],
|
|
|
|
)
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
@reporter.example_passed(example)
|
|
|
|
when "example_pending"
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
example =
|
|
|
|
FakeExample.from_obj(
|
|
|
|
message[:example],
|
|
|
|
process_id: message[:process_id],
|
|
|
|
command_string: message[:command_string],
|
|
|
|
)
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
@reporter.example_pending(example)
|
|
|
|
when "example_failed"
|
DEV: Introduce automatic reruns to RSpec tests on Github actions (#24811)
What motivated this change?
Our builds on Github actions have been extremely flaky mostly due to system tests. This has led to a drop in confidence
in our test suite where our developers tend to assume that a failed job is due to a flaky system test. As a result, we
have had occurrences where changes that resulted in legitimate test failures are merged into the `main` branch because developers
assumed it was a flaky test.
What does this change do?
This change seeks to reduce the flakiness of our builds on Github Actions by automatically re-running RSpec tests once when
they fail. If a failed test passes subsequently in the re-run, we mark the test as flaky by logging it into a file on disk
which is then uploaded as an artifact of the Github workflow run. We understand that automatically re-runs will lead to
lower accuracy of our tests but we accept this as an acceptable trade-off since a fragile build has a much greater impact
on our developers' time. Internally, the Discourse development team will be running a service to fetch the flaky tests
which have been logged for internal monitoring.
How is the change implemented?
1. A `--retry-and-log-flaky-tests` CLI flag is added to the `bin/turbo_rspec` CLI which will then initialize `TurboTests::Runner`
with the `retry_and_log_flaky_tests` kwarg set to `true`.
2. When the `retry_and_log_flaky_tests` kwarg is set to `true` for `TurboTests::Runner`, we will register an additional
formatter `Flaky::FailuresLoggerFormatter` to the `TurboTests::Reporter` in the `TurboTests::Runner#run` method.
The `Flaky::FailuresLoggerFormatter` has a simple job of logging all failed examples to a file on disk when running all the
tests. The details of the failed example which are logged can be found in `TurboTests::Flaky::FailedExample.to_h`.
3. Once all the tests have been run once, we check the result for any failed examples and if there are, we read the file on
disk to fetch the `location_rerun_location` of the failed examples which is then used to run the tests in a new RSpec process.
In the rerun, we configure a `TurboTests::Flaky::FlakyDetectorFormatter` with RSpec which removes all failed examples from the log file on disk since those examples are not flaky tests. Note that if there are too many failed examples on the first run, we will deem the failures to likely not be due to flaky tests and not re-run the test failures. As of writing, the threshold of failed examples is set to 10. If there are more than 10 failed examples, we will not re-run the failures.
2023-12-13 07:18:27 +08:00
|
|
|
example =
|
|
|
|
FakeExample.from_obj(
|
|
|
|
message[:example],
|
|
|
|
process_id: message[:process_id],
|
|
|
|
command_string: message[:command_string],
|
|
|
|
)
|
|
|
|
|
2019-06-21 08:59:01 +08:00
|
|
|
@reporter.example_failed(example)
|
2019-10-09 22:40:06 +08:00
|
|
|
@failure_count += 1
|
|
|
|
if fail_fast_met
|
|
|
|
@threads.each(&:kill)
|
|
|
|
break
|
|
|
|
end
|
2020-06-23 13:34:58 +08:00
|
|
|
when "message"
|
|
|
|
@reporter.message(message[:message])
|
2019-06-21 08:59:01 +08:00
|
|
|
when "seed"
|
|
|
|
when "close"
|
2020-06-23 11:45:18 +08:00
|
|
|
when "error"
|
2020-06-23 13:34:58 +08:00
|
|
|
@reporter.error_outside_of_examples
|
2020-06-23 11:45:18 +08:00
|
|
|
@error = true
|
2019-06-21 08:59:01 +08:00
|
|
|
when "exit"
|
|
|
|
exited += 1
|
2023-05-13 00:22:15 +08:00
|
|
|
|
|
|
|
if @reporter.formatters.any? { |f| f.is_a?(DocumentationFormatter) }
|
|
|
|
@reporter.message("[#{message[:process_id]}] DONE (#{exited}/#{@num_processes + 1})")
|
|
|
|
end
|
|
|
|
|
2019-08-29 17:56:43 +08:00
|
|
|
break if exited == @num_processes + 1
|
2019-06-21 08:59:01 +08:00
|
|
|
else
|
|
|
|
STDERR.puts("Unhandled message in main process: #{message}")
|
|
|
|
end
|
|
|
|
|
|
|
|
STDOUT.flush
|
|
|
|
end
|
|
|
|
rescue Interrupt
|
|
|
|
end
|
|
|
|
end
|
2019-10-09 22:40:06 +08:00
|
|
|
|
|
|
|
def fail_fast_met
|
2022-12-21 09:33:52 +08:00
|
|
|
!@fail_fast.nil? && @failure_count >= @fail_fast
|
2019-10-09 22:40:06 +08:00
|
|
|
end
|
2019-06-21 08:59:01 +08:00
|
|
|
end
|
|
|
|
end
|