Comments (8)
One idea for this is to track states externally, but provide enough hooks to support it. The advantage here is that consumers of turmoil have the ability to understand the encoded bytes that are written and read via the networking types, as they define the protocols.
Currently, Sim::run()
runs an event loop that drives all the hosts and the network forward. We could break the logic out into a public step API that allows callers to control this. Instead of running a simulation to completion, the test needs manage its own event loop.
Within the loop we'd:
- step (run a single iteration on each host) and hold all packets
- introspect the network to identify possible states
- pick a state, track it, and proceed by releasing messages for delivery
- repeat until we hit a terminal path
We'll also need a top level loop to traverse all the possible paths through the graph. Each time we hit a terminal path we can rebuild the simulation (note things are deterministic) and run a new path.
from turmoil.
Some thoughts from the original repo:
from turmoil.
We could break the logic out into a public step API that allows callers to control this
This would be very useful to us but for a different reason. We need to run a custom piece of logic after every tick in order to coordinate some tasks that are not managed by tokio. Being able to manage our own even loop would allow us to do that easily.
from turmoil.
We could break the logic out into a public step API that allows callers to control this
This would be very useful to us but for a different reason. We need to run a custom piece of logic after every tick in order to coordinate some tasks that are not managed by tokio. Being able to manage our own even loop would allow us to do that easily.
Great to hear that this would be useful! I think the initial changes would make your use case very easy to support.
from turmoil.
#76 adds "step" capabilities.
from turmoil.
#77 adds the ability to hold messages using patterns.
from turmoil.
Once 0.5 is released we should have the building blocks in place to start exploring.
from turmoil.
I'm closing this issue as exposing the above linked hooks make it possible to investigate and choose different paths throughout the execution of the sim.
from turmoil.
Related Issues (20)
- support ephemeral port assignments HOT 1
- Implement additional UDP features HOT 1
- Fix AsyncRead impl for TcpStream
- Regex matching throws exception in Pair
- Question: Reproduce, Random and Time HOT 4
- meets Tokio `enble_io()` error HOT 4
- Return errors instead of panicking, when sending invalid packets. HOT 2
- Support multiple network interfaces HOT 8
- Loopback is incomplete
- Error `ConnectionRefused` when binding UdpSocket to `localhost` HOT 2
- Spawn blocking blocking sim runtime HOT 1
- Infinitely running. HOT 2
- Fix socket close behavior when there is unread data
- Add support for SO_LINGER to `TcpStream`
- Add warning for blocking tasks that block the sim
- Support one-way partitions
- Enable testing of backpressure from TCP connections HOT 2
- Network partition should cause 'host unreachable' not 'connection refused' for TCP HOT 2
- Re-starting a crashed host with bounce panics
- More interesting examples of testing distribution system building blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turmoil.