mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-30 06:59:43 +01:00
Merge branch 'master' into joel/low-level-testing (fixing borked rebase, sorry!)
This commit is contained in:
commit
378d92efcf
1 changed files with 17 additions and 16 deletions
|
@ -99,25 +99,26 @@ testClientRequestNoServer =
|
||||||
reqResult @?= (Left GRPCIOTimeout)
|
reqResult @?= (Left GRPCIOTimeout)
|
||||||
|
|
||||||
testServerAwaitNoClient :: TestTree
|
testServerAwaitNoClient :: TestTree
|
||||||
testServerAwaitNoClient =
|
testServerAwaitNoClient = testCase "server wait times out when no client " $ do
|
||||||
grpcTest "Server - registered call handler timeout" $ \grpc -> do
|
withGRPC $ \grpc -> do
|
||||||
let conf = (ServerConfig "localhost" 50051 [("/foo", "localhost", Normal)])
|
let conf = (ServerConfig "localhost" 50051 [("/foo", "localhost", Normal)])
|
||||||
withServer grpc conf $ \server -> do
|
withServer grpc conf $ \server -> do
|
||||||
let method = head (registeredMethods server)
|
let method = head (registeredMethods server)
|
||||||
result <- serverHandleNormalRegisteredCall server method 1 M.empty $
|
result <- serverHandleNormalRegisteredCall server method 1 M.empty $
|
||||||
\_ _ -> return ("", M.empty, M.empty, StatusDetails "details")
|
\_ _ -> return ("", M.empty, M.empty, StatusDetails "details")
|
||||||
result @?= Left GRPCIOTimeout
|
result @?= Left GRPCIOTimeout
|
||||||
|
|
||||||
testServerUnregisteredAwaitNoClient :: TestTree
|
testServerUnregisteredAwaitNoClient :: TestTree
|
||||||
testServerUnregisteredAwaitNoClient =
|
testServerUnregisteredAwaitNoClient =
|
||||||
grpcTest "Server - unregistered call handler timeout" $ \grpc -> do
|
testCase "server wait times out when no client -- unregistered method " $ do
|
||||||
let conf = ServerConfig "localhost" 50051 []
|
withGRPC $ \grpc -> do
|
||||||
withServer grpc conf $ \server -> do
|
let conf = ServerConfig "localhost" 50051 []
|
||||||
result <- serverHandleNormalCall server 10 M.empty $
|
withServer grpc conf $ \server -> do
|
||||||
\_ _ -> return ("", M.empty, StatusDetails "")
|
result <- serverHandleNormalCall server 10 M.empty $
|
||||||
case result of
|
\_ _ -> return ("", M.empty, StatusDetails "")
|
||||||
Left err -> error $ show err
|
case result of
|
||||||
Right _ -> return ()
|
Left err -> error $ show err
|
||||||
|
Right _ -> return ()
|
||||||
|
|
||||||
testPayloadLowLevel :: TestTree
|
testPayloadLowLevel :: TestTree
|
||||||
testPayloadLowLevel =
|
testPayloadLowLevel =
|
||||||
|
|
Loading…
Reference in a new issue