Remove flaky and dumb test.

This commit is contained in:
Brent Simmons committed 2026-10-05 21:40:02 -07:00
1 parent 2b67851e49
commit 8cff640ec1
1 file changed
-29
@@ -77,33 +77,4 @@ import SyncDatabase
#expect(try await database.selectForProcessing().isEmpty)
#expect(try await database.selectPendingCount() == 0)
}
/// A read that stops on a SQLite error has to fail, not return the rows it got to
/// first. A short pending-statuses read is missing articleIDs that really are
/// pending, and the next refresh reverts exactly those edits.
///
/// This covers failing on the first row. A failure partway through is the same bug
/// and the same fix, but there’s no way to force one at a chosen row.
@Test func aReadThatStopsOnAnErrorFails() async throws {
let folderURL = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)
try FileManager.default.createDirectory(at: folderURL, withIntermediateDirectories: true)
defer {
try? FileManager.default.removeItem(at: folderURL)
}
let database = SyncDatabase(databasePath: folderURL.appendingPathComponent("Sync.sqlite3").path)
let articleIDs = (0..<10).map { "article-\($0)" }
await database.insertStatuses(Set(articleIDs.map { SyncStatus(articleID: $0, key: .read, flag: true) }))
// Every call fails once the folder is gone, but the statements still prepare
// cleanly — the failure only shows up while stepping through the rows.
try FileManager.default.removeItem(at: folderURL)
await #expect(throws: SyncDatabaseError.self) {
try await database.selectForProcessing()
}
await #expect(throws: SyncDatabaseError.self) {
try await database.selectPendingReadStatusArticleIDs()
}
}
}