@@ -16,6 +16,7 @@ import System.IO (hClose)
1616import Network (connectTo, PortID (PortNumber))
1717import Network.Wai.Handler.Warp
1818import Data.Maybe (mapMaybe)
19+import Control.Concurrent (threadDelay)
1920
2021main :: IO ()
2122main = hspec spec
@@ -30,6 +31,7 @@ testRange range out crange = it title $ withApp defaultSettings app $ \port -> d
3031 S.hPutStr handle "Range: bytes="
3132 S.hPutStr handle range
3233 S.hPutStr handle "\r\n\r\n"
34+ threadDelay 10000
3335 bss <- fmap (lines . filter (/= '\r') . S8.unpack) $ S.hGetSome handle 1024
3436 hClose handle
3537 out `shouldBe` last bss
@@ -51,6 +53,7 @@ testPartial :: Integer -- ^ offset
5153testPartial offset count out = it title $ withApp defaultSettings app $ \port -> do
5254 handle <- connectTo "127.0.0.1" $ PortNumber $ fromIntegral port
5355 S.hPutStr handle "GET / HTTP/1.0\r\n\r\n"
56+ threadDelay 10000
5457 bss <- fmap (lines . filter (/= '\r') . S8.unpack) $ S.hGetSome handle 1024
5558 hClose handle
5659 out `shouldBe` last bss