Running Consecutive Tests From ghci with hspec

montmorency BUSINESS

If I load and run a /Main/Test.hs module to ghci from an IHP app and run the test suite one I get expected behaviour. But if a test fails and then I try to run main again from ghci prompt I get a:

    # PENDING: exception in beforeAll-hook (see previous failure)

on test that run successfully previously and on subsequent test

  1) Visits Controller has no existing visits
       uncaught exception: IOException of type ResourceBusy
       openFile: resource busy (file is locked)

I'm wondering if a test fails is there a db lock due to the transaction block? Is there a way to manually release the lock?

Amitai Burstein

I saw this error when the server wasn't running. Do you have ./start running on another tab?

montmorency BUSINESS

Hey! Yes I have tried two ways. One with the dev server running in a separate tab and one where I started a postgres server with make postgres and have it as a background process. The error occurs in both cases on the second run of the tests.

Amitai Burstein

Are you able to reproduce on another computer/ Gitpod?