diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift index 3eb2c56ae..ca5a10378 100644 --- a/Tests/GRDBTests/DatabaseReaderTests.swift +++ b/Tests/GRDBTests/DatabaseReaderTests.swift @@ -677,4 +677,52 @@ class DatabaseReaderTests : GRDBTestCase { try await test(AnyDatabaseReader(makeDatabaseQueue())) try await test(AnyDatabaseWriter(makeDatabaseQueue())) } + + // Regression test for https://github.com/groue/GRDB.swift/pull/1797 + func test_cancellation_does_not_impact_other_tasks() async throws { + func test(_ dbReader: some DatabaseReader) async throws { + // Numbers that have the test fail more or less reliably + // (on my machine) unless the #1797 patch is applied. + let repeatCount = 30 + let taskCount = 400 + for _ in 0..