tests: randomize db file name to fix io errors (#16)

* tests: check file doesn't exist in store tests after

* Revert "tests: check file doesn't exist in store tests after"

This reverts commit de624433a9.

* [WIP] tests: randomize db file

* [WIP] tests: try runIO to get filename into after

* random db file name for agent tests

* tests: randomize DB file name

* tests: increase SMP agent start delay

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
Efim PoberezkinandEvgeny Poberezkin committed 2021-02-26 18:11:22 +04:00
1 parent 3efb15ecb3
commit c1f15c9d93
4 files changed
+24 -8

No files matched your search

+6 -4
View File
@@ -49,7 +49,8 @@ addRcvQueueQuery =
|]
data SQLiteStore = SQLiteStore
{ conn :: DB.Connection,
{ dbFilename :: String,
conn :: DB.Connection,
serversLock :: TMVar (),
rcvQueuesLock :: TMVar (),
sndQueuesLock :: TMVar (),
@@ -58,8 +59,8 @@ data SQLiteStore = SQLiteStore
}
newSQLiteStore :: MonadUnliftIO m => String -> m SQLiteStore
newSQLiteStore dbFile = do
conn <- liftIO $ DB.open dbFile
newSQLiteStore dbFilename = do
conn <- liftIO $ DB.open dbFilename
liftIO $ createSchema conn
serversLock <- newTMVarIO ()
rcvQueuesLock <- newTMVarIO ()
@@ -68,7 +69,8 @@ newSQLiteStore dbFile = do
messagesLock <- newTMVarIO ()
return
SQLiteStore
{ conn,
{ dbFilename,
conn,
serversLock,
rcvQueuesLock,
sndQueuesLock,