Skip to content

Commit 5498b00

Browse files
committed
WP
1 parent 870c2a0 commit 5498b00

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ unit_union_credit_0 =
219219
-- | Blob refs into a union don't get invalidated when updating the union's
220220
-- input tables.
221221
unit_union_blobref_invalidation :: Assertion
222-
unit_union_blobref_invalidation = forM_ @[] @IO @Int [1..100] $ \_ ->
222+
unit_union_blobref_invalidation = (\_ -> performMajorGC) =<< (forM_ @[] @IO @Int [1..100] $ \_ ->
223223
withTempIOHasBlockIO "test" $ \hfs hbio ->
224224
withOpenSession nullTracer hfs hbio testSalt (FS.mkFsPath []) $ \sess ->
225225
withTableWith config sess $ \t1 -> do
@@ -234,7 +234,7 @@ unit_union_blobref_invalidation = forM_ @[] @IO @Int [1..100] $ \_ ->
234234
inserts t1 (fmap (\i -> (Key1 i, Value1 i, Nothing)) [1000..2000])
235235

236236
-- try to resolve the blob refs we obtained earlier
237-
void $ retrieveBlobs sess (V.mapMaybe R.getBlob res)
237+
void $ retrieveBlobs sess (V.mapMaybe R.getBlob res))
238238
where
239239
config = defaultTableConfig {
240240
confWriteBufferAlloc = AllocNumEntries 4

0 commit comments

Comments
 (0)