diff --git a/flake.nix b/flake.nix index 619deb98..bb194719 100644 --- a/flake.nix +++ b/flake.nix @@ -33,8 +33,8 @@ outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs: packagePostOverrides = { pkgs }: with pkgs; with haskell.lib; [ - disableExecutableProfiling - disableLibraryProfiling + enableExecutableProfiling + enableLibraryProfiling dontBenchmark dontCoverage dontDistribute diff --git a/hbs2-tests/test/TestChunkWriter.hs b/hbs2-tests/test/TestChunkWriter.hs index a0322351..c212eb88 100644 --- a/hbs2-tests/test/TestChunkWriter.hs +++ b/hbs2-tests/test/TestChunkWriter.hs @@ -39,6 +39,12 @@ main = do bytes <- B8.pack <$> replicateM size (uniformM g) + let hash = hashObject bytes + + let psz = calcChunks (fromIntegral size) (fromIntegral chu) + + psz' <- shuffleM psz + withSystemTempDirectory "cww-test" $ \dir -> do let opts = [ StoragePrefix (dir ".test-cww") @@ -63,20 +69,12 @@ main = do failed <- replicateM times $ do - let hash = hashObject bytes - - let psz = calcChunks (fromIntegral size) (fromIntegral chu) - - psz' <- shuffleM psz - - forM_ psz' $ \(o,s) -> do + forConcurrently_ psz' $ \(o,s) -> do let t = B8.take s $ B8.drop o bytes writeChunk cw 1 hash (fromIntegral o) t h2 <- getHash cw 1 hash - -- commitBlock cw 1 hash - if Just hash /= h2 then do pure [1] else do