-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I'd like to add a custom check, a real connection to the database with a test query. Something like this:
mariaDBReady :: TestDBInfo -> WaitUntilReady
mariaDBReady db = WaitReady $ \container -> do
withFrozenCallStack $ do
let (endpointHost, endpointPort) = containerAddress container db.dbPort
ci =
defaultConnectInfo
{ connectHost = unpack endpointHost
, connectPort = fromIntegral endpointPort
, connectUser = unpack db.dbUsername
, connectPassword = unpack db.dbPassword
, connectDatabase = unpack db.dbName
}
wait = do
r <- try (connect ci >>= flip query_ "select 2 + 3")
case r of
Right [Only (i :: Int)] -> do
pure ()
Left (ex :: IOException) -> do
threadDelay 500000
wait
liftIO waitThis is currently not possible since WaitReady is not public.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels