Skip to content

TestFoundation: use Thread.sleep(forTimeInterval:) rather than sleep #2127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions TestFoundation/TestOperationQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class TestOperationQueue : XCTestCase {
for i in 0..<5 {
let operation = BlockOperation {
valueOperations.append(i)
sleep(2)
Thread.sleep(forTimeInterval: 2)
}
operations.append(operation)
}
Expand All @@ -139,14 +139,14 @@ class TestOperationQueue : XCTestCase {

let operation1 = BlockOperation {
valueOperations.append(0)
sleep(2)
Thread.sleep(forTimeInterval: 2)
}
operation1.queuePriority = .high
operations.append(operation1)

let operation2 = BlockOperation {
valueOperations.append(1)
sleep(2)
Thread.sleep(forTimeInterval: 2)
}
operation2.queuePriority = .high
operations.append(operation2)
Expand Down