Skip to content

Commit 5bd4bcb

Browse files
committed
WP
1 parent 870c2a0 commit 5bd4bcb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

test/Database/LSMTree/Class.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import qualified Database.LSMTree.Internal.Paths as RIP
2828
import qualified Database.LSMTree.Internal.Types as RT (Table (..))
2929
import qualified Database.LSMTree.Internal.Unsafe as RU (SessionEnv (..),
3030
Table (..), withKeepSessionOpen)
31+
import GHC.Stack (HasCallStack)
3132
import Test.Util.FS (flipRandomBitInRandomFileHardlinkSafe)
3233
import Test.Util.QC (Choice)
3334

@@ -106,31 +107,35 @@ class (IsSession (Session h)) => IsTable h where
106107
-> m (V.Vector b)
107108

108109
updates ::
109-
( IOLike m
110+
( HasCallStack
111+
, IOLike m
110112
, C k v b
111113
)
112114
=> h m k v b
113115
-> V.Vector (k, Update v b)
114116
-> m ()
115117

116118
inserts ::
117-
( IOLike m
119+
( HasCallStack
120+
, IOLike m
118121
, C k v b
119122
)
120123
=> h m k v b
121124
-> V.Vector (k, v, Maybe b)
122125
-> m ()
123126

124127
deletes ::
125-
( IOLike m
128+
( HasCallStack
129+
, IOLike m
126130
, C k v b
127131
)
128132
=> h m k v b
129133
-> V.Vector k
130134
-> m ()
131135

132136
upserts ::
133-
( IOLike m
137+
( HasCallStack
138+
, IOLike m
134139
, C k v b
135140
)
136141
=> h m k v b

test/Test/Database/LSMTree/UnitTests.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Database.LSMTree as R
1717
import Database.LSMTree.Extras.Generators ()
1818
import Database.LSMTree.Internal.Serialise (SerialisedKey)
1919
import qualified System.FS.API as FS
20+
import System.Mem (performMajorGC)
2021
import qualified Test.QuickCheck.Arbitrary as QC
2122
import qualified Test.QuickCheck.Gen as QC
2223
import Test.Tasty (TestTree, testGroup)
@@ -219,7 +220,7 @@ unit_union_credit_0 =
219220
-- | Blob refs into a union don't get invalidated when updating the union's
220221
-- input tables.
221222
unit_union_blobref_invalidation :: Assertion
222-
unit_union_blobref_invalidation = forM_ @[] @IO @Int [1..100] $ \_ ->
223+
unit_union_blobref_invalidation = (\_ -> performMajorGC) =<< (forM_ @[] @IO @Int [1..100] $ \_ ->
223224
withTempIOHasBlockIO "test" $ \hfs hbio ->
224225
withOpenSession nullTracer hfs hbio testSalt (FS.mkFsPath []) $ \sess ->
225226
withTableWith config sess $ \t1 -> do
@@ -234,7 +235,7 @@ unit_union_blobref_invalidation = forM_ @[] @IO @Int [1..100] $ \_ ->
234235
inserts t1 (fmap (\i -> (Key1 i, Value1 i, Nothing)) [1000..2000])
235236

236237
-- try to resolve the blob refs we obtained earlier
237-
void $ retrieveBlobs sess (V.mapMaybe R.getBlob res)
238+
void $ retrieveBlobs sess (V.mapMaybe R.getBlob res))
238239
where
239240
config = defaultTableConfig {
240241
confWriteBufferAlloc = AllocNumEntries 4

0 commit comments

Comments
 (0)