Skip to content

Commit 054e265

Browse files
authored
fix: Restore retry integration tests (#780)
1 parent 6d3bb34 commit 054e265

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,9 @@ let package = Package(
240240
name: "SmithyWaitersAPITests",
241241
dependencies: ["Smithy", "SmithyWaitersAPI"]
242242
),
243+
.testTarget(
244+
name: "SmithyRetriesTests",
245+
dependencies: ["ClientRuntime", "SmithyRetriesAPI", "SmithyRetries", "SmithyTestUtil"]
246+
),
243247
].compactMap { $0 }
244248
)

Tests/SmithyRetriesTests/RetryIntegrationTests.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import SmithyRetriesAPI
1717

1818
// This test class reproduces the "Standard Mode" test cases defined in "Retry Behavior 2.0"
1919
final class RetryIntegrationTests: XCTestCase {
20-
private let partitionIDKey = AttributeKey<String>(name: "PartitionID")
2120
private let partitionID = "partition"
2221

2322
private var context: Context!
@@ -28,7 +27,7 @@ final class RetryIntegrationTests: XCTestCase {
2827
private func setUp(availableCapacity: Int, maxCapacity: Int, maxRetriesBase: Int, maxBackoff: TimeInterval) async {
2928
// Setup the HTTP context, used by the retry middleware
3029
context = Context(attributes: Attributes())
31-
context.attributes.set(key: partitionIDKey, value: partitionID)
30+
context.partitionID = partitionID
3231
context.socketTimeout = 60.0
3332
context.estimatedSkew = 30.0
3433

@@ -239,7 +238,12 @@ private class TestOutputHandler: Handler {
239238
}
240239

241240
func verifyResult(atEnd: Bool = true) async throws {
242-
guard let testStep = latestTestStep else { return }
241+
guard let testStep = latestTestStep else {
242+
if atEnd {
243+
XCTFail("No test steps were run! Encountered error: \(String(describing: finalError!))")
244+
}
245+
return
246+
}
243247

244248
// Test available capacity
245249
let availableCapacity = await quota.availableCapacity

0 commit comments

Comments
 (0)