diff --git a/Tests/SotoCoreTests/Concurrency/ExpiringValueTests.swift b/Tests/SotoCoreTests/Concurrency/ExpiringValueTests.swift index fbb3eb1e5..32ca50e84 100644 --- a/Tests/SotoCoreTests/Concurrency/ExpiringValueTests.swift +++ b/Tests/SotoCoreTests/Concurrency/ExpiringValueTests.swift @@ -39,9 +39,10 @@ final class ExpiringValueTests: XCTestCase { /// Test when a value is just about to expire it returns current value and kicks off /// new task to get new value + #if swift(>=5.9) // makeStream doesn't exist in earlier versions of swift func testJustAboutToExpireValue() async throws { let expiringValue = ExpiringValue(0, expires: Date() + 1, threshold: 3) - let (stream, source) = AsyncStream.makeStream(of: Void.self) + let (stream, source) = AsyncStream.makeStream() let value = try await expiringValue.getValue { source.finish() try await Task.sleep(nanoseconds: 1000) @@ -51,6 +52,7 @@ final class ExpiringValueTests: XCTestCase { // test it return current value XCTAssertEqual(value, 0) } + #endif /// Test closure is not called if value has not expired func testClosureNotCalled() async throws {