packages feed

pqi-conformance 1.0.2.0 → 1.0.2.1

raw patch · 3 files changed

+18/−9 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,9 @@+# v1.0.2.1++## Fixes++- Fix a flaky test+ # v1.0.2.0  ## Non-breaking
pqi-conformance.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: pqi-conformance-version: 1.0.2.0+version: 1.0.2.1 category: Database, PostgreSQL, Testing synopsis: Differential conformance tests for pqi adapters description:
src/library/Pqi/Conformance/Operation/Cancel.hs view
@@ -36,16 +36,19 @@         pure (sent, cancelled, results, usable)      it "leaves the connection usable after cancelling a short-running query" \conninfo ->-      differential adapter conninfo \connection -> do-        outcomes <- replicateM 3 do-          sent <- Pqi.sendQuery connection "select pg_sleep(0.1)"+      differential adapter conninfo \connection ->+        replicateM 3 do+          _ <- Pqi.sendQuery connection "select pg_sleep(0.1)"           threadDelay 50000           handle <- Pqi.getCancel connection-          cancelled <- for handle Pqi.cancel-          results <- drainResults connection-          usable <- execScenario "select 1" connection-          pure (sent, cancelled, results, usable)-        pure outcomes+          _ <- for handle Pqi.cancel+          -- The cancel races the statement's own ~100 ms completion, so the+          -- drained result is non-deterministically FatalError (SQLSTATE 57014)+          -- or TuplesOk; comparing it across adapters is what made this test+          -- flaky. Drain it to settle the connection, then assert only the+          -- property the test is named for: the next command still works.+          _ <- drainResults connection+          execScenario "select 1" connection      Cleanup.spec adapter     Stale.spec adapter