Structure
InfrastructureRetryScheduler
Manages infrastructure-level retry logic for test invocations across all platforms.
struct InfrastructureRetrySchedulerOverview
InfrastructureRetryScheduler wraps any async test operation and retries it when the platform-specific InfrastructureFailureClassifier determines that a failure is transient. It uses exponential backoff with jitter to avoid thundering-herd problems.
Design
┌─────────────────────────────────────────┐
│ InfrastructureRetryScheduler │
│ ┌───────────┐ ┌──────────────────┐ │
│ │ RetryOpts │ │ Classifier │ │
│ │ (config) │ │ (platform impl) │ │
│ └───────────┘ └──────────────────┘ │
└─────────────────────────────────────────┘
│ │
exponential isRetryable(log:)
backoff + jitterUsage
let scheduler = InfrastructureRetryScheduler(
options: retryOptions,
classifier: IOSInfrastructureClassifier()
)
let result = try await scheduler.execute(label: "iPhone 16 Pro") {
try await runXcodeBuild(...)
}Topics
Structures
struct OptionsConfiguration for infrastructure retry behavior.
struct TestFailureContextDescribes a test execution failure with its log output for classification.
Initializers
init(options: InfrastructureRetryScheduler.Options, classifier: any InfrastructureFailureClassifier)Creates a scheduler with the given options and platform classifier.
Instance Methods
func execute<T>(label: String, operation: () async throws -> T, extractContext: (any Error) -> InfrastructureRetryScheduler.TestFailureContext?) async throws -> TExecute an operation with infrastructure retry protection.
Type Methods
static func executeIfConfigured<T>(options: InfrastructureRetryScheduler.Options?, classifier: any InfrastructureFailureClassifier, label: String, operation: () async throws -> T, extractContext: (any Error) -> InfrastructureRetryScheduler.TestFailureContext?) async throws -> TConvenience: if options are nil (block absent), runs the operation once without retry. If options are present, creates a scheduler and executes with retry.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype