@@ -16,6 +16,7 @@ import qualified Data.Map.Strict as Map
1616import Data.Maybe (isJust , mapMaybe )
1717import qualified Data.Vector as V
1818import Data.Word
19+ import Database.LSMTree.Class.Common (testSalt )
1920import Database.LSMTree.Extras.Generators ()
2021import Database.LSMTree.Internal.BlobRef
2122import Database.LSMTree.Internal.Config
@@ -58,7 +59,7 @@ newSession ::
5859newSession (Positive (Small bufferSize)) es =
5960 ioProperty $
6061 withTempIOHasBlockIO " newSession" $ \ hfs hbio ->
61- withSession nullTracer hfs hbio (FS. mkFsPath [] ) $ \ session ->
62+ withSession nullTracer hfs hbio testSalt (FS. mkFsPath [] ) $ \ session ->
6263 withTable session conf (updates const es')
6364 where
6465 conf = testTableConfig {
@@ -73,9 +74,9 @@ restoreSession ::
7374restoreSession (Positive (Small bufferSize)) es =
7475 ioProperty $
7576 withTempIOHasBlockIO " restoreSession" $ \ hfs hbio -> do
76- withSession nullTracer hfs hbio (FS. mkFsPath [] ) $ \ session1 ->
77+ withSession nullTracer hfs hbio testSalt (FS. mkFsPath [] ) $ \ session1 ->
7778 withTable session1 conf (updates const es')
78- withSession nullTracer hfs hbio (FS. mkFsPath [] ) $ \ session2 ->
79+ withSession nullTracer hfs hbio testSalt (FS. mkFsPath [] ) $ \ session2 ->
7980 withTable session2 conf (updates const es')
8081 where
8182 conf = testTableConfig {
@@ -86,8 +87,8 @@ restoreSession (Positive (Small bufferSize)) es =
8687sessionDirLocked :: Property
8788sessionDirLocked = ioProperty $
8889 withTempIOHasBlockIO " sessionDirLocked" $ \ hfs hbio -> do
89- bracket (openSession nullTracer hfs hbio (FS. mkFsPath [] )) closeSession $ \ _sesh1 ->
90- bracket (try @ SessionDirLockedError $ openSession nullTracer hfs hbio (FS. mkFsPath [] )) tryCloseSession $ \ case
90+ bracket (openSession nullTracer hfs hbio testSalt (FS. mkFsPath [] )) closeSession $ \ _sesh1 ->
91+ bracket (try @ SessionDirLockedError $ openSession nullTracer hfs hbio testSalt (FS. mkFsPath [] )) tryCloseSession $ \ case
9192 Left (ErrSessionDirLocked _dir) -> pure ()
9293 x -> assertFailure $ " Opening a session twice in the same directory \
9394 \should fail with an ErrSessionDirLocked error, but \
@@ -97,15 +98,15 @@ sessionDirCorrupted :: Assertion
9798sessionDirCorrupted =
9899 withTempIOHasBlockIO " sessionDirCorrupted" $ \ hfs hbio -> do
99100 FS. createDirectory hfs (FS. mkFsPath [" unexpected-directory" ])
100- bracket (try @ SessionDirCorruptedError (openSession nullTracer hfs hbio (FS. mkFsPath [] ))) tryCloseSession $ \ case
101+ bracket (try @ SessionDirCorruptedError (openSession nullTracer hfs hbio testSalt (FS. mkFsPath [] ))) tryCloseSession $ \ case
101102 Left (ErrSessionDirCorrupted _dir) -> pure ()
102103 x -> assertFailure $ " Restoring a session in a directory with a wrong \
103104 \layout should fail with a ErrSessionDirCorrupted, but \
104105 \it returned this instead: " <> showLeft " Session" x
105106
106107sessionDirDoesNotExist :: Assertion
107108sessionDirDoesNotExist = withTempIOHasBlockIO " sessionDirDoesNotExist" $ \ hfs hbio -> do
108- bracket (try @ SessionDirDoesNotExistError (openSession nullTracer hfs hbio (FS. mkFsPath [" missing-dir" ]))) tryCloseSession $ \ case
109+ bracket (try @ SessionDirDoesNotExistError (openSession nullTracer hfs hbio testSalt (FS. mkFsPath [" missing-dir" ]))) tryCloseSession $ \ case
109110 Left (ErrSessionDirDoesNotExist _dir) -> pure ()
110111 x -> assertFailure $ " Opening a session in a non-existent directory should \
111112 \fail with a ErrSessionDirDoesNotExist error, but it \
@@ -140,7 +141,7 @@ prop_roundtripCursor ::
140141 -> Property
141142prop_roundtripCursor lb ub kops = ioProperty $
142143 withTempIOHasBlockIO " prop_roundtripCursor" $ \ hfs hbio -> do
143- withSession nullTracer hfs hbio (FS. mkFsPath [] ) $ \ sesh -> do
144+ withSession nullTracer hfs hbio testSalt (FS. mkFsPath [] ) $ \ sesh -> do
144145 withTable sesh conf $ \ t -> do
145146 updates resolve (coerce kops) t
146147 fromCursor <- withCursor resolve (toOffsetKey lb) t $ \ c ->
0 commit comments