Skip to content

Commit 86f2eb6

Browse files
committed
Disable Scan command unit test until #23 is completed
1 parent ea781e1 commit 86f2eb6

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

Tests/RediStackIntegrationTests/Commands/BasicCommandsTests.swift

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,31 @@ final class BasicCommandsTests: RediStackIntegrationTestCase {
8686
XCTAssertEqual(first, "100")
8787
}
8888

89-
func test_scan() throws {
90-
var dataset: [RedisKey] = .init(repeating: "", count: 10)
91-
for index in 1...15 {
92-
let key = RedisKey("key\(index)\(index % 2 == 0 ? "_even" : "_odd")")
93-
dataset.append(key)
94-
_ = try connection.set(key, to: "\(index)").wait()
95-
}
96-
97-
var (cursor, keys) = try connection.scan(count: 5).wait()
98-
XCTAssertGreaterThanOrEqual(cursor, 0)
99-
XCTAssertGreaterThanOrEqual(keys.count, 5)
100-
101-
(_, keys) = try connection.scan(startingFrom: cursor, count: 8).wait()
102-
XCTAssertGreaterThanOrEqual(keys.count, 8)
103-
104-
(cursor, keys) = try connection.scan(matching: "*_odd").wait()
105-
XCTAssertGreaterThanOrEqual(cursor, 0)
106-
XCTAssertGreaterThanOrEqual(keys.count, 1)
107-
XCTAssertLessThanOrEqual(keys.count, 7)
108-
109-
(cursor, keys) = try connection.scan(matching: "*_even*").wait()
110-
XCTAssertGreaterThanOrEqual(cursor, 0)
111-
XCTAssertGreaterThanOrEqual(keys.count, 1)
112-
XCTAssertLessThanOrEqual(keys.count, 7)
113-
}
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_scan() throws {
92+
// var dataset: [RedisKey] = .init(repeating: "", count: 10)
93+
// for index in 1...15 {
94+
// let key = RedisKey("key\(index)\(index % 2 == 0 ? "_even" : "_odd")")
95+
// dataset.append(key)
96+
// _ = try connection.set(key, to: "\(index)").wait()
97+
// }
98+
//
99+
// var (cursor, keys) = try connection.scan(count: 5).wait()
100+
// XCTAssertGreaterThanOrEqual(cursor, 0)
101+
// XCTAssertGreaterThanOrEqual(keys.count, 5)
102+
//
103+
// (_, keys) = try connection.scan(startingFrom: cursor, count: 8).wait()
104+
// XCTAssertGreaterThanOrEqual(keys.count, 8)
105+
//
106+
// (cursor, keys) = try connection.scan(matching: "*_odd").wait()
107+
// XCTAssertGreaterThanOrEqual(cursor, 0)
108+
// XCTAssertGreaterThanOrEqual(keys.count, 1)
109+
// XCTAssertLessThanOrEqual(keys.count, 7)
110+
//
111+
// (cursor, keys) = try connection.scan(matching: "*_even*").wait()
112+
// XCTAssertGreaterThanOrEqual(cursor, 0)
113+
// XCTAssertGreaterThanOrEqual(keys.count, 1)
114+
// XCTAssertLessThanOrEqual(keys.count, 7)
115+
// }
114116
}

Tests/RediStackIntegrationTests/XCTestManifests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ extension BasicCommandsTests {
1010
("test_echo", test_echo),
1111
("test_expire", test_expire),
1212
("test_ping", test_ping),
13-
("test_scan", test_scan),
1413
("test_select", test_select),
1514
("test_swapDatabase", test_swapDatabase),
1615
]

0 commit comments

Comments
 (0)