| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.NetworkSpec
Description
Test the real networking layer
Synopsis
- spec :: Spec
- etcdSpec :: Spec
- lo :: IsString s => s
- withSettingsBurstProxy :: PortNumber -> Int -> (PortNumber -> IO Int -> IO a) -> IO a
- data PeerConfig2 = PeerConfig2 {
- aliceConfig :: NetworkConfiguration
- bobConfig :: NetworkConfiguration
- setup2Peers :: FilePath -> IO PeerConfig2
- data PeerConfig3 = PeerConfig3 {
- aliceConfig :: NetworkConfiguration
- bobConfig :: NetworkConfiguration
- carolConfig :: NetworkConfiguration
- setup3Peers :: FilePath -> IO PeerConfig3
- prop_canRoundtripCBOREncoding :: (ToCBOR a, FromCBOR a, Eq a, Show a) => a -> Property
- newRecordingCallback :: MonadLabelledSTM m => m (NetworkCallback msg m, m msg, m Connectivity)
Documentation
The etcd tests, kept out of spec so that test/Main.hs can turn them
into a tasty group of their own and run them one at a time.
They must not run concurrently: each starts etcd on a port obtained by
binding a socket, reading the assigned port and closing it again, so two at
once can be handed the same port, or one test's peer port can be another's
derived client port. Whichever etcd binds second dies with EADDRINUSE, which
withEtcdNetwork turns straight into a failure.
withSettingsBurstProxy Source #
Arguments
| :: PortNumber | Upstream etcd client port. |
| -> Int | How many SETTINGS frames to burst at the client. |
| -> (PortNumber -> IO Int -> IO a) | Given the proxy's port and the count of non-ACK SETTINGS frames forwarded to the client so far. |
| -> IO a |
Run a TCP proxy in front of an etcd client port that reproduces #2817's SETTINGS burst deterministically.
Both directions are forwarded verbatim, and once the client starts sending
request data (so an RPC is in flight, as in production, where the data being
sent is what makes etcd's window ramp fire) the proxy pushes burst empty
SETTINGS frames at the client. Those are legal at any point; the client ACKs
each and etcd ignores stray ACKs.
Injecting beats provoking: how many frames grpc-go's estimator emits depends on how much data lands in one round-trip, which on an idle machine stops at 3, one under the limit. Reaching 5 needs the scheduling latency of the reporter's six-nodes-on-one-host setup.
data PeerConfig2 Source #
Constructors
| PeerConfig2 | |
Fields
| |
setup2Peers :: FilePath -> IO PeerConfig2 Source #
data PeerConfig3 Source #
Constructors
| PeerConfig3 | |
Fields
| |
setup3Peers :: FilePath -> IO PeerConfig3 Source #
prop_canRoundtripCBOREncoding :: (ToCBOR a, FromCBOR a, Eq a, Show a) => a -> Property Source #
newRecordingCallback :: MonadLabelledSTM m => m (NetworkCallback msg m, m msg, m Connectivity) Source #