Skip to Content Skip to Search

Abstract base class for test distribution strategies. Subclasses implement different ways of assigning tests to workers.

Methods
A
C
I
P
T

Instance Public methods

add_test(test)

Add a test to be distributed to workers. @param test [Array] Test tuple: [class, method, reporter]

# File activesupport/lib/active_support/testing/parallelization/test_distributor.rb, line 11
def add_test(test)
  raise NotImplementedError
end

close()

Close the distributor. No more work will be accepted.

# File activesupport/lib/active_support/testing/parallelization/test_distributor.rb, line 34
def close
  # Optional
end

interrupt()

Clear all pending work (called on interrupt).

# File activesupport/lib/active_support/testing/parallelization/test_distributor.rb, line 23
def interrupt
  # Optional
end

pending?()

Check if there is pending work. @return [Boolean] true if work is pending

# File activesupport/lib/active_support/testing/parallelization/test_distributor.rb, line 29
def pending?
  raise NotImplementedError
end

take(worker_id:)

Retrieve the next test for a specific worker. @param worker_id [Integer] The worker requesting work @return [Array, nil] Test tuple or nil if no work available

# File activesupport/lib/active_support/testing/parallelization/test_distributor.rb, line 18
def take(worker_id:)
  raise NotImplementedError
end