Skip to content

tmp-postgres fails with uncaught exception: StartError StartPostgresFailed (ExitFailure 1) #278

Description

@tonyalaribe

Any chance we get more detailed errors?

I've been getting the following crash when I try to run a test with tmp-postgres.

       uncaught exception: StartError
       StartPostgresFailed (ExitFailure 1)

The error doesn't give me any information about what I'm doing wrong, so I have no idea how to proceed other than trying different random things in my hspec withSetup implmentation.

A have a withSetup configured as follows:

withSetup :: (Pool Connection -> IO ()) -> IO ()
withSetup f = do
  -- Helper to throw exceptions
  let throwE x = either throwIO pure =<< x

  throwE $ withDbCache $ \dbCache -> withConfig (cacheConfig dbCache) $ \db -> do
    conn <- liftIO $ connectPostgreSQL (TmpPostgres.toConnectionString db)
    initializationRes <- Migrations.runMigration conn Migrations.defaultOptions MigrationInitialization
    x <- withSnapshot db $ \snapshot -> do
      withConfig (snapshotConfig snapshot) $ \migratedDb -> f =<< createPool (connectPostgreSQL $ toConnectionString migratedDb) close 2 60 10
    pTraceShowM x 
    pass
    ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions