Skip to content

Commit 524f3b4

Browse files
committed
Updated the connection pool test to be more robust on CI
1 parent 2018e41 commit 524f3b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/Tests/Connection/ConnectionPoolTests.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,19 @@ class ConnectionPoolTestCase: BaseTestCase {
108108

109109
func testThatConnectionPoolCanExecuteReadOnlyClosure() throws {
110110
// Given
111+
let connection = try Connection(storageLocation: storageLocation)
112+
try TestTables.createAndPopulateAgentsTable(using: connection)
111113
let pool = ConnectionPool(storageLocation: storageLocation)
112114

113115
var count: Int?
114116

115117
// When
116118
try pool.execute { connection in
117-
count = try connection.query("SELECT count(*) FROM sqlite_master where type = 'table'")
119+
count = try connection.query("SELECT count(*) FROM agents")
118120
}
119121

120122
// Then
121-
XCTAssertEqual(count, 0)
123+
XCTAssertGreaterThanOrEqual(count ?? -1, 0)
122124
}
123125

124126
func testThatConnectionPoolFailsToExecuteWriteClosure() {

0 commit comments

Comments
 (0)