Skip to content

Commit 93180b8

Browse files
authored
Merge pull request #2127 from compnerd/sleeping-beauty-sleeps-again
TestFoundation: use `Thread.sleep(forTimeInterval:)` rather than `sleep`
2 parents 42c3fe6 + db3ccb1 commit 93180b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

TestFoundation/TestOperationQueue.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TestOperationQueue : XCTestCase {
120120
for i in 0..<5 {
121121
let operation = BlockOperation {
122122
valueOperations.append(i)
123-
sleep(2)
123+
Thread.sleep(forTimeInterval: 2)
124124
}
125125
operations.append(operation)
126126
}
@@ -139,14 +139,14 @@ class TestOperationQueue : XCTestCase {
139139

140140
let operation1 = BlockOperation {
141141
valueOperations.append(0)
142-
sleep(2)
142+
Thread.sleep(forTimeInterval: 2)
143143
}
144144
operation1.queuePriority = .high
145145
operations.append(operation1)
146146

147147
let operation2 = BlockOperation {
148148
valueOperations.append(1)
149-
sleep(2)
149+
Thread.sleep(forTimeInterval: 2)
150150
}
151151
operation2.queuePriority = .high
152152
operations.append(operation2)

0 commit comments

Comments
 (0)