Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing imports #109

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Data.Pool as Pool
import Test.Tasty.HUnit
import Debug.Trace
-- import Control.Exception.Lifted (finally, catch, bracket)
import Control.Monad (void)
import Control.Monad (void, forM, forM_, replicateM, when)
import Control.Monad.Logger
import Control.Monad.Reader
import Data.Aeson as Aeson
Expand Down Expand Up @@ -387,20 +387,20 @@ testJobDeletion appPool jobPool = testCase "job immediae deletion" $ do
withNamedJobMonitor tname jobPool (\cfg -> cfg { Job.cfgDelayedJobDeletion = Just $ Job.defaultDelayedJobDeletion tname pinterval, Job.cfgDefaultMaxAttempts = 2 }) $ \_logRef -> do
Pool.withResource appPool $ \conn -> do

let assertDeletedJob msg jid =
let assertDeletedJob msg jid =
Job.findJobByIdIO conn tname jid >>= \case
Nothing -> pure ()
Just _ -> assertFailure msg

successJob <- Job.createJob conn tname (PayloadSucceed 0)
failJob <- Job.createJob conn tname (PayloadAlwaysFail 0)
delaySeconds (Job.defaultPollingInterval * 3)

assertDeletedJob "Expecting successful job to be immediately deleted" (jobId successJob)

j <- ensureJobId conn tname (jobId failJob)
assertEqual "Exepcting job to be in Failed status" Job.Failed (jobStatus j)

delaySeconds (Job.defaultPollingInterval * 4)
assertDeletedJob "Expecting failed job to be deleted after adequate delay" (jobId failJob)
where
Expand Down
Loading