Skip to content

Commit 476cdc5

Browse files
committed
Make sure every thread has at least one read.
1 parent d2721ed commit 476cdc5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

SQLiteTests/ConnectionPoolTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ class ConnectionPoolTests : SQLiteTestCase {
4848

4949
print("started", threadNumber)
5050

51-
while !quit {
51+
while !quit || reads <= 0 {
5252
self.pool.read { conn in
5353
let _ = try! conn.prepare("SELECT name FROM test WHERE id = ?").scalar(threadNumber) as! String
5454
reads += 1
5555
}
5656
}
5757

58-
XCTAssertTrue(reads > 0, "Thread \(threadNumber) did not read.")
5958
print("ended at", reads, "reads")
6059

6160
ex.fulfill()

0 commit comments

Comments
 (0)