Skip to content

Commit

Permalink
configure test retries and test optimisation in parallel using thread…
Browse files Browse the repository at this point in the history
…ed Workers
  • Loading branch information
anmarchenko committed Sep 2, 2024
1 parent 2296b7c commit b58b477
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/datadog/ci/remote/component.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require_relative "../worker"

module Datadog
module CI
module Remote
Expand Down Expand Up @@ -27,8 +29,17 @@ def configure(test_session)
end
end

test_optimisation.configure(library_configuration, test_session)
test_retries.configure(library_configuration, test_session)
# configure different components in parallel because they might
configuration_workers = [
Worker.new { test_optimisation.configure(library_configuration, test_session) },
Worker.new { test_retries.configure(library_configuration, test_session) }
]

# launch configuration workers
configuration_workers.each(&:perform)

# block until all workers are done (or 60 seconds has passed)
configuration_workers.each(&:wait_until_done)
end

private
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog/ci/test_retries/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def configure(library_settings, test_session)
if @retry_new_tests_unique_tests_set.empty?
@retry_new_tests_enabled = false
@retry_new_tests_fault_reason = "unique tests set is empty"

Datadog.logger.debug("Unique tests set is empty, retrying new tests disabled")
else
Utils::Telemetry.distribution(
Ext::Telemetry::METRIC_EFD_UNIQUE_TESTS_RESPONSE_TESTS,
Expand Down

0 comments on commit b58b477

Please sign in to comment.