Skip to content

Commit 58a3ca8

Browse files
committed
TestNSLock: Lower thread test from 1000 to 10 threads and 10secs to 2secs
1 parent 6d862d6 commit 58a3ca8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

TestFoundation/TestNSLock.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class TestNSLock: XCTestCase {
6969
func test_threadsAndLocks() {
7070
let condition = NSCondition()
7171
let lock = NSLock()
72-
let threadCount = 1000
73-
let endSeconds: Double = 10
72+
let threadCount = 10
73+
let endSeconds: Double = 2
7474

7575
let endTime = Date.init(timeIntervalSinceNow: endSeconds)
7676
var threadsStarted = Array<Bool>(repeating: false, count: threadCount)
@@ -85,8 +85,8 @@ class TestNSLock: XCTestCase {
8585
condition.lock()
8686
condition.wait()
8787
condition.unlock()
88-
for _ in 1...100 {
89-
let r = (endSeconds * drand48()) / 100
88+
for _ in 1...50 {
89+
let r = (endSeconds * drand48()) / 50
9090
Thread.sleep(forTimeInterval: r)
9191
if lock.lock(before: endTime) {
9292
lock.unlock()

0 commit comments

Comments
 (0)