Skip to content

Commit

Permalink
Issue #26: make test_serverResponseNoConfigurationDirectory submit mu…
Browse files Browse the repository at this point in the history
…ltiple requests per @effectfully's suggestion
  • Loading branch information
Marko Dimjašević committed Nov 26, 2019
1 parent 97e6222 commit 4dcb900
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/Fencer/Server/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ where

import BasePrelude

import Control.Monad (replicateM_)
import Data.ByteString (ByteString)
import qualified Data.Vector as Vector
import GHC.Exts (fromList)
Expand Down Expand Up @@ -105,11 +106,15 @@ test_serverResponseNoConfigurationDirectory =
Right rules -> do
atomically (setRules (serverAppState server) (domainToRuleTree <$> rules))
withService server $ \service -> do
response <- Proto.rateLimitServiceShouldRateLimit service $
Grpc.ClientNormalRequest request 1 mempty
expectSuccess
(genericOKResponse, Grpc.StatusOk)
response
let communicationRoundtrip = do
response <- Proto.rateLimitServiceShouldRateLimit service $
Grpc.ClientNormalRequest request 1 mempty
expectSuccess
(genericOKResponse, Grpc.StatusOk)
response
-- Test that having a sequence of requests does not
-- change the server state
replicateM_ 5 communicationRoundtrip
where
request :: Proto.RateLimitRequest
request = Proto.RateLimitRequest
Expand Down

0 comments on commit 4dcb900

Please sign in to comment.