Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Jan 5, 2025
1 parent cb04c4e commit 9d636e5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,27 @@ main = do
Left (SessionUsageError (Session.QueryError _ _ (Session.ClientError _))) -> True
_ -> False
it "Connection errors cause eviction of connection" $ withDefaultPool $ \pool -> do
res <- use pool $ closeConnSession >> selectOneSession
res <- use pool $ closeConnSession >> selectOneSession
res <- use pool $ closeConnSession >> selectOneSession
_ <- use pool $ closeConnSession >> selectOneSession
_ <- use pool $ closeConnSession >> selectOneSession
_ <- use pool $ closeConnSession >> selectOneSession
res <- use pool $ selectOneSession
shouldSatisfy res $ isRight
it "Connection gets returned to the pool after normal use" $ withDefaultPool $ \pool -> do
res <- use pool $ selectOneSession
res <- use pool $ selectOneSession
res <- use pool $ selectOneSession
res <- use pool $ selectOneSession
_ <- use pool $ selectOneSession
_ <- use pool $ selectOneSession
_ <- use pool $ selectOneSession
_ <- use pool $ selectOneSession
res <- use pool $ selectOneSession
shouldSatisfy res $ isRight
it "Connection gets returned to the pool after non-connection error" $ withDefaultPool $ \pool -> do
res <- use pool $ badQuerySession
res <- use pool $ badQuerySession
res <- use pool $ badQuerySession
res <- use pool $ badQuerySession
_ <- use pool $ badQuerySession
_ <- use pool $ badQuerySession
_ <- use pool $ badQuerySession
_ <- use pool $ badQuerySession
res <- use pool $ selectOneSession
shouldSatisfy res $ isRight
it "The pool remains usable after release" $ withDefaultPool $ \pool -> do
res <- use pool $ selectOneSession
_ <- use pool $ selectOneSession
release pool
res <- use pool $ selectOneSession
shouldSatisfy res $ isRight
Expand Down Expand Up @@ -145,7 +145,7 @@ main = do
res2 <- use pool $ getSettingSession "testing.foo"
res2 `shouldBe` Right (Just "hello world")
-- busy sleep, to keep connection alive
forM_ [1 .. 10] $ \_ -> do
forM_ [1 :: Int .. 10] $ \_ -> do
r <- use pool $ selectOneSession
r `shouldBe` Right 1
threadDelay 100_000 -- 0.1s
Expand Down

0 comments on commit 9d636e5

Please sign in to comment.