Skip to content

Commit 233bd2a

Browse files
committed
Fix warning in tests
1 parent 15dbd83 commit 233bd2a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Tests/APNSTests/APNSAuthenticationTokenManagerTests.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@testable import APNSCore
1616
import Crypto
1717
import XCTest
18+
import NIOConcurrencyHelpers
1819

1920
final class APNSAuthenticationTokenManagerTests: XCTestCase {
2021
private static let signingKey = """
@@ -129,11 +130,19 @@ final class TestClock<Duration: DurationProtocol & Hashable>: Clock {
129130
}
130131

131132
let minimumResolution: Duration = .zero
132-
var now: Instant
133+
private let _now: NIOLockedValueBox<Instant>
134+
135+
var now: Instant {
136+
get {
137+
self._now.withLockedValue { $0 }
138+
} set {
139+
self._now.withLockedValue { $0 = newValue }
140+
}
141+
}
133142

134143

135144
public init(now: Instant = .init()) {
136-
self.now = .init()
145+
self._now = .init(now)
137146
}
138147

139148
public func sleep(until deadline: Instant, tolerance: Duration? = nil) async throws {

0 commit comments

Comments
 (0)