diff --git a/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs b/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs index 5a9d8792..3882b5b3 100644 --- a/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs +++ b/hbs2-core/lib/HBS2/Actors/ChunkWriter.hs @@ -112,7 +112,7 @@ runChunkWriter2 w = do stop <- liftIO $ readTVarIO (stopped w) if stop then do - ks <- liftIO $ take 20 <$> Cache.keys cache + ks <- liftIO $ take 100 <$> Cache.keys cache liftIO $ for_ ks $ \k -> flush w k else do ks <- liftIO $ Cache.keys cache diff --git a/hbs2-tests/hie.yaml b/hbs2-tests/hie.yaml new file mode 100644 index 00000000..ace9c439 --- /dev/null +++ b/hbs2-tests/hie.yaml @@ -0,0 +1,4 @@ +cradle: + cabal: + - path: "test/Peer2Main.hs" + component: "hbs2-tests:exe:test-peer-run" diff --git a/hbs2-tests/test/Peer2Main.hs b/hbs2-tests/test/Peer2Main.hs index a0b391f9..0e0492d2 100644 --- a/hbs2-tests/test/Peer2Main.hs +++ b/hbs2-tests/test/Peer2Main.hs @@ -224,10 +224,11 @@ blockDownloadLoop cw = do fix \next -> do + -- debug $ "WIP:" <+> pretty wip + job <- liftIO $ atomically $ Q.readTBQueue blq wip <- liftIO $ blocksInProcess cw - debug $ "WIP:" <+> pretty wip if wip > 10 then do pause ( 1 :: Timeout 'Seconds ) @@ -445,6 +446,12 @@ main = do our <- async $ runTestPeer p0 $ \s cw -> do let blk = hasBlock s + + void $ async $ forever $ do + pause ( 1 :: Timeout 'Seconds ) + wip <- blocksInProcess cw + debug $ "blocks wip:" <+> pretty wip + runPeerM (AnyStorage s) fake p0 $ do adapter <- mkAdapter cw env <- ask