From ecbb684994263be9a2b3bdfe6899e847bce7d3fc Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Mon, 17 Feb 2014 01:57:37 +0400 Subject: UDP tracker RPC: test concurrent queries --- tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/Network') diff --git a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs index fd7d1232..3ecc139d 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs @@ -1,6 +1,6 @@ {-# LANGUAGE RecordWildCards #-} module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where - +import Control.Concurrent.Async import Control.Monad import Data.Default import Data.List as L @@ -47,3 +47,9 @@ spec = parallel $ do withManager def $ \ mgr -> do xs <- scrape mgr uri [def] L.length xs `shouldSatisfy` (>= 1) + + describe "Manager" $ do + it "should handle arbitrary intermixed concurrent queries" $ do + withManager def $ \ mgr -> do + _ <- mapConcurrently (\ _ -> scrape mgr uri [def]) [1..100] + return () \ No newline at end of file -- cgit v1.2.3