Skip to content

Commit 83f8b78

Browse files
committed
Disable additional scan command unit tests until #23 is fixed
1 parent 41f9377 commit 83f8b78

File tree

4 files changed

+91
-88
lines changed

4 files changed

+91
-88
lines changed

Tests/RediStackIntegrationTests/Commands/HashCommandsTests.swift

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -134,30 +134,32 @@ final class HashCommandsTests: RediStackIntegrationTestCase {
134134
let float = try connection.hincrbyfloat(Float(-10.23523), field: "first", in: #function).wait()
135135
XCTAssertEqual(float, -3.95523)
136136
}
137-
138-
func test_hscan() throws {
139-
var dataset: [String: String] = [:]
140-
for index in 1...15 {
141-
let key = "key\(index)\(index % 2 == 0 ? "_even" : "_odd")"
142-
dataset[key] = "\(index)"
143-
}
144-
_ = try connection.hmset(dataset, in: #function).wait()
145-
146-
var (cursor, fields) = try connection.hscan(#function, count: 5).wait()
147-
XCTAssertGreaterThanOrEqual(cursor, 0)
148-
XCTAssertGreaterThanOrEqual(fields.count, 5)
149-
150-
(_, fields) = try connection.hscan(#function, startingFrom: cursor, count: 8).wait()
151-
XCTAssertGreaterThanOrEqual(fields.count, 8)
152-
153-
(cursor, fields) = try connection.hscan(#function, matching: "*_odd").wait()
154-
XCTAssertGreaterThanOrEqual(cursor, 0)
155-
XCTAssertGreaterThanOrEqual(fields.count, 1)
156-
XCTAssertLessThanOrEqual(fields.count, 8)
157-
158-
(cursor, fields) = try connection.hscan(#function, matching: "*_ev*").wait()
159-
XCTAssertGreaterThanOrEqual(cursor, 0)
160-
XCTAssertGreaterThanOrEqual(fields.count, 1)
161-
XCTAssertLessThanOrEqual(fields.count, 7)
162-
}
137+
138+
// TODO: #23 -- Rework Scan Unit Test
139+
// This is extremely flakey, and causes non-deterministic failures because of the assert on key counts
140+
// func test_hscan() throws {
141+
// var dataset: [String: String] = [:]
142+
// for index in 1...15 {
143+
// let key = "key\(index)\(index % 2 == 0 ? "_even" : "_odd")"
144+
// dataset[key] = "\(index)"
145+
// }
146+
// _ = try connection.hmset(dataset, in: #function).wait()
147+
//
148+
// var (cursor, fields) = try connection.hscan(#function, count: 5).wait()
149+
// XCTAssertGreaterThanOrEqual(cursor, 0)
150+
// XCTAssertGreaterThanOrEqual(fields.count, 5)
151+
//
152+
// (_, fields) = try connection.hscan(#function, startingFrom: cursor, count: 8).wait()
153+
// XCTAssertGreaterThanOrEqual(fields.count, 8)
154+
//
155+
// (cursor, fields) = try connection.hscan(#function, matching: "*_odd").wait()
156+
// XCTAssertGreaterThanOrEqual(cursor, 0)
157+
// XCTAssertGreaterThanOrEqual(fields.count, 1)
158+
// XCTAssertLessThanOrEqual(fields.count, 8)
159+
//
160+
// (cursor, fields) = try connection.hscan(#function, matching: "*_ev*").wait()
161+
// XCTAssertGreaterThanOrEqual(cursor, 0)
162+
// XCTAssertGreaterThanOrEqual(fields.count, 1)
163+
// XCTAssertLessThanOrEqual(fields.count, 7)
164+
// }
163165
}

Tests/RediStackIntegrationTests/Commands/SetCommandsTests.swift

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -212,44 +212,46 @@ final class SetCommandsTests: RediStackIntegrationTestCase {
212212
XCTAssertEqual(results[2].string, "3")
213213
XCTAssertEqual(results[3].string, "4")
214214
}
215-
216-
func test_sscan() throws {
217-
let key: RedisKey = #function
218-
let dataset = [
219-
"Copenhagen, Denmark",
220-
"Roskilde, Denmark",
221-
"Herning, Denmark",
222-
"Kolding, Denmark",
223-
"Taastrup, Denmark",
224-
"London, England",
225-
"Bath, England",
226-
"Birmingham, England",
227-
"Cambridge, England",
228-
"Durham, England",
229-
"Seattle, United States",
230-
"Austin, United States",
231-
"New York City, United States",
232-
"San Francisco, United States",
233-
"Honolulu, United States"
234-
]
235-
236-
_ = try connection.sadd(dataset, to: key).wait()
237-
238-
var (cursor, results) = try connection.sscan(key, count: 5).wait()
239-
XCTAssertGreaterThanOrEqual(cursor, 0)
240-
XCTAssertGreaterThanOrEqual(results.count, 5)
241-
242-
(_, results) = try connection.sscan(key, startingFrom: cursor, count: 8).wait()
243-
XCTAssertGreaterThanOrEqual(results.count, 8)
244-
245-
(cursor, results) = try connection.sscan(key, matching: "*Denmark").wait()
246-
XCTAssertGreaterThanOrEqual(cursor, 0)
247-
XCTAssertGreaterThanOrEqual(results.count, 1)
248-
XCTAssertLessThanOrEqual(results.count, 5)
249-
250-
(cursor, results) = try connection.sscan(key, matching: "*ing*").wait()
251-
XCTAssertGreaterThanOrEqual(cursor, 0)
252-
XCTAssertGreaterThanOrEqual(results.count, 1)
253-
XCTAssertLessThanOrEqual(results.count, 3)
254-
}
215+
216+
// TODO: #23 -- Rework Scan Unit Test
217+
// This is extremely flakey, and causes non-deterministic failures because of the assert on key counts
218+
// func test_sscan() throws {
219+
// let key: RedisKey = #function
220+
// let dataset = [
221+
// "Copenhagen, Denmark",
222+
// "Roskilde, Denmark",
223+
// "Herning, Denmark",
224+
// "Kolding, Denmark",
225+
// "Taastrup, Denmark",
226+
// "London, England",
227+
// "Bath, England",
228+
// "Birmingham, England",
229+
// "Cambridge, England",
230+
// "Durham, England",
231+
// "Seattle, United States",
232+
// "Austin, United States",
233+
// "New York City, United States",
234+
// "San Francisco, United States",
235+
// "Honolulu, United States"
236+
// ]
237+
//
238+
// _ = try connection.sadd(dataset, to: key).wait()
239+
//
240+
// var (cursor, results) = try connection.sscan(key, count: 5).wait()
241+
// XCTAssertGreaterThanOrEqual(cursor, 0)
242+
// XCTAssertGreaterThanOrEqual(results.count, 5)
243+
//
244+
// (_, results) = try connection.sscan(key, startingFrom: cursor, count: 8).wait()
245+
// XCTAssertGreaterThanOrEqual(results.count, 8)
246+
//
247+
// (cursor, results) = try connection.sscan(key, matching: "*Denmark").wait()
248+
// XCTAssertGreaterThanOrEqual(cursor, 0)
249+
// XCTAssertGreaterThanOrEqual(results.count, 1)
250+
// XCTAssertLessThanOrEqual(results.count, 5)
251+
//
252+
// (cursor, results) = try connection.sscan(key, matching: "*ing*").wait()
253+
// XCTAssertGreaterThanOrEqual(cursor, 0)
254+
// XCTAssertGreaterThanOrEqual(results.count, 1)
255+
// XCTAssertLessThanOrEqual(results.count, 3)
256+
// }
255257
}

Tests/RediStackIntegrationTests/Commands/SortedSetCommandsTests.swift

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,27 @@ final class SortedSetCommandsTests: RediStackIntegrationTestCase {
8585
score = try connection.zscore(of: 30, in: #function).wait()
8686
XCTAssertEqual(score, 11)
8787
}
88-
89-
func test_zscan() throws {
90-
var (cursor, results) = try connection.zscan(key, count: 5).wait()
91-
XCTAssertGreaterThanOrEqual(cursor, 0)
92-
XCTAssertGreaterThanOrEqual(results.count, 5)
93-
94-
(_, results) = try connection.zscan(key, startingFrom: cursor, count: 8).wait()
95-
XCTAssertGreaterThanOrEqual(results.count, 8)
96-
97-
(cursor, results) = try connection.zscan(key, matching: "1*").wait()
98-
XCTAssertEqual(cursor, 0)
99-
XCTAssertEqual(results.count, 2)
100-
XCTAssertEqual(results[0].1, 1)
101-
102-
(cursor, results) = try connection.zscan(key, matching: "*0").wait()
103-
XCTAssertEqual(cursor, 0)
104-
XCTAssertEqual(results.count, 1)
105-
XCTAssertEqual(results[0].1, 10)
106-
}
88+
89+
// TODO: #23 -- Rework Scan Unit Test
90+
// This is extremely flakey, and causes non-deterministic failures because of the assert on key counts
91+
// func test_zscan() throws {
92+
// var (cursor, results) = try connection.zscan(key, count: 5).wait()
93+
// XCTAssertGreaterThanOrEqual(cursor, 0)
94+
// XCTAssertGreaterThanOrEqual(results.count, 5)
95+
//
96+
// (_, results) = try connection.zscan(key, startingFrom: cursor, count: 8).wait()
97+
// XCTAssertGreaterThanOrEqual(results.count, 8)
98+
//
99+
// (cursor, results) = try connection.zscan(key, matching: "1*").wait()
100+
// XCTAssertEqual(cursor, 0)
101+
// XCTAssertEqual(results.count, 2)
102+
// XCTAssertEqual(results[0].1, 1)
103+
//
104+
// (cursor, results) = try connection.zscan(key, matching: "*0").wait()
105+
// XCTAssertEqual(cursor, 0)
106+
// XCTAssertEqual(results.count, 1)
107+
// XCTAssertEqual(results[0].1, 10)
108+
// }
107109

108110
func test_zrank() throws {
109111
let futures = [

Tests/RediStackIntegrationTests/XCTestManifests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ extension HashCommandsTests {
3030
("test_hlen", test_hlen),
3131
("test_hmget", test_hmget),
3232
("test_hmset", test_hmset),
33-
("test_hscan", test_hscan),
3433
("test_hset", test_hset),
3534
("test_hsetnx", test_hsetnx),
3635
("test_hstrlen", test_hstrlen),
@@ -93,7 +92,6 @@ extension SetCommandsTests {
9392
("test_spop", test_spop),
9493
("test_srandmember", test_srandmember),
9594
("test_srem", test_srem),
96-
("test_sscan", test_sscan),
9795
("test_sunion", test_sunion),
9896
("test_sunionstore", test_sunionstore),
9997
]
@@ -126,7 +124,6 @@ extension SortedSetCommandsTests {
126124
("test_zrevrangebylex", test_zrevrangebylex),
127125
("test_zrevrangebyscore", test_zrevrangebyscore),
128126
("test_zrevrank", test_zrevrank),
129-
("test_zscan", test_zscan),
130127
("test_zscore", test_zscore),
131128
("test_zunionstore", test_zunionstore),
132129
]

0 commit comments

Comments
 (0)