From 7d1c84344d174f86d4f0a7396931bab4ac7c0d90 Mon Sep 17 00:00:00 2001 From: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:01:02 +0400 Subject: [PATCH] adjust logic --- tests/ChatTests.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/ChatTests.hs b/tests/ChatTests.hs index d36798acfc..6455277671 100644 --- a/tests/ChatTests.hs +++ b/tests/ChatTests.hs @@ -78,15 +78,16 @@ testStressServer = testChat2' (i * 2 -1, aliceProfile) (i * 2, bobProfile) $ \alice bob -> do connectUsers alice bob - forever $ loop alice bob sentTVar 0 + loop alice bob sentTVar 0 ) - (take 100 ([1 ..] :: [Int])) + (take 1 ([1 ..] :: [Int])) where loop :: TestCC -> TestCC -> TVar Int -> Int -> IO () loop alice bob sentTVar k = do - alice <##> bob - when (k `mod` 100 == 0) $ atomically $ modifyTVar sentTVar (+ 200) - threadDelay 500 + alice `send` "@bob hi" + bob `send` "@alice hi" + when (k `mod` 1000 == 0) $ atomically $ modifyTVar sentTVar (+ 2000) + threadDelay 5000 loop alice bob sentTVar $ k + 1 testAddContact :: IO ()