Skip to content

Commit f0c0cad

Browse files
committed
Fix Sendable checks
1 parent 75370b3 commit f0c0cad

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

Tests/WordPressKitTests/WordPressKitTests/Tests/Utilities/URLSessionHelperTests.swift

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import CryptoKit
33
import XCTest
44
import OHHTTPStubs
55
import OHHTTPStubsSwift
6+
import os
67

78
@testable import WordPressKit
89

@@ -399,9 +400,19 @@ class BackgroundURLSessionHelperTests: URLSessionHelperTests {
399400

400401
}
401402

402-
private class TestBackgroundURLSessionDelegate: BackgroundURLSessionDelegate {
403-
var startedReceivingResponse = false
404-
var completionCalled = false
403+
private final class TestBackgroundURLSessionDelegate: BackgroundURLSessionDelegate {
404+
405+
private let _startedReceivingResponse = OSAllocatedUnfairLock(initialState: false)
406+
var startedReceivingResponse: Bool {
407+
get { _startedReceivingResponse.withLock { $0 } }
408+
set { _startedReceivingResponse.withLock { $0 = newValue } }
409+
}
410+
411+
private let _completionCalled = OSAllocatedUnfairLock(initialState: false)
412+
var completionCalled: Bool {
413+
get { _completionCalled.withLock { $0 } }
414+
set { _completionCalled.withLock { $0 = newValue } }
415+
}
405416

406417
override func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
407418
startedReceivingResponse = true

0 commit comments

Comments
 (0)