diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-17 01:57:37 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-17 01:57:37 +0400 |
commit | ecbb684994263be9a2b3bdfe6899e847bce7d3fc (patch) | |
tree | 0987efb61668c366248a67310bad4fd70bbf6e5c /tests/Network/BitTorrent/Tracker/RPC | |
parent | e9ea74560023caf15a702a303bbd06237c879cb0 (diff) |
UDP tracker RPC: test concurrent queries
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/RPC')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ | |||
1 | {-# LANGUAGE RecordWildCards #-} | 1 | {-# LANGUAGE RecordWildCards #-} |
2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where | 2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where |
3 | 3 | import Control.Concurrent.Async | |
4 | import Control.Monad | 4 | import Control.Monad |
5 | import Data.Default | 5 | import Data.Default |
6 | import Data.List as L | 6 | import Data.List as L |
@@ -47,3 +47,9 @@ spec = parallel $ do | |||
47 | withManager def $ \ mgr -> do | 47 | withManager def $ \ mgr -> do |
48 | xs <- scrape mgr uri [def] | 48 | xs <- scrape mgr uri [def] |
49 | L.length xs `shouldSatisfy` (>= 1) | 49 | L.length xs `shouldSatisfy` (>= 1) |
50 | |||
51 | describe "Manager" $ do | ||
52 | it "should handle arbitrary intermixed concurrent queries" $ do | ||
53 | withManager def $ \ mgr -> do | ||
54 | _ <- mapConcurrently (\ _ -> scrape mgr uri [def]) [1..100] | ||
55 | return () \ No newline at end of file | ||