@@ -375,11 +375,13 @@ spec = do
375375 getHeaderValue hDate (responseHeaders res) `shouldBe` Just "date"
376376
377377 it "streaming echo #249" $ do
378+ countVar <- newTVarIO (0 :: Int)
378379 let app req f = f $ responseStream status200 [] $ \write _ -> do
379380 let loop = do
380381 bs <- requestBody req
381382 unless (S.null bs) $ do
382383 write $ byteString bs
384+ atomically $ modifyTVar countVar (+ 1)
383385 loop
384386 loop
385387 withApp defaultSettings app $ \port -> do
@@ -387,6 +389,9 @@ spec = do
387389 sendAll sock "POST / HTTP/1.1\r\ntransfer-encoding: chunked\r\n\r\n"
388390 threadDelay 10000
389391 sendAll sock "5\r\nhello\r\n0\r\n\r\n"
392+ atomically $ do
393+ count <- readTVar countVar
394+ check $ count >= 1
390395 bs <- safeRecv sock 4096
391396 S.takeWhile (/= 13) bs `shouldBe` "HTTP/1.1 200 OK"
392397