Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Instream drop on demand #1975
To be able to test the behavior of various tests a way to artificially induce failures at different layers of the network stack is required.
We propose using env vars which are picked up inside the in_stream crate to drop connections, messages or packets depending on the test requirement. The currently implementation only drops ws connections by ignoring incoming and outgoing messages for the duration of an error burst.
As this crate is to be used by both the sim2h worker and sim2h server we can simulate failures at either end with no extra work.
Dropping ws Connections
The env var
The failure model follows a telegraph process which switched between being in an error state (burst) or an ok state. The time between errors and the error burst duration are exponentially distributed random variables independent of each other.
It should be possible to run any of the existing tests with this env var set to see how they operate under unreliable network conditions
Would run the app spec tests with the client experiencing an error burst on average ever 2 seconds for an average of 100ms.
Would run the sim2h server with the same failure rates
It is also integrated with the trycp server so calling the RPC method spawn with a failureModel object will set the env vars internally e.g.:
( any new tickets/concerns that were discovered or created during this work but aren't in scope for review here )
- summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)
neonphog left a comment
I like the