-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel command sequences #20
Comments
No, that is still on the todo-list. Unluckily it's the most complicated part and since parallel processing in go is quite different to multi-threading in java/scala, I still have to find a suitable example (in go) where it would make sense to have this feature. |
Thanks for the clarification! |
I have a use-case in mind for this - testing the different parts of a timeseries database with concurrent operations (user operations - reads/writes; housekeeping tasks - serialisation to disk/cleanup/etc). We've reproduced numerous bugs by running operations in parallel, some examples - m3db/m3#773, m3db/m3#502, m3db/m3#409, m3db/m3#372. We currently create such tests once we see issues in production but we'd obviously prefer to catch them earlier. To that effect, we're looking to add parallel stateful property tests. Here's how I'm thinking the implementation in gopter might end up looking like (based on some ideas from Erlang): generate a linear sequence of operations
And then simulate the operations using go-routines (with a gate to ensure all are up and runnable before execution starts). Open questions:
Ideas to try if doesn't work very well:
|
@untoldwind I'd love to get your feedback before I start implementing any of this. |
ScalaCheck operates a bit more simple to my understanding. It "just" generates several sequences of commands/operations and applies them in parallel on the system under test checking the expected state within each thread. The "problem" with this approach is that usually you just see that something goes haywire without a clear idea what exactly caused the problem. Even though in most cases it's already enough to know that there is a problem, the branching idea might generate some more helpful insights. I'm not so sure about the Yield() though (maybe just because I'm not very keen on build switches in general). For starters it might be more helpful just to run the command-sequences with twice the number of GOMAXPROCS. Or maybe add a WaitGroup after each command (i.e. at all or some of the '->' in your diagram), though this might have a huge impact on the runtime of the tests. |
I've been skimming through the docs, and coming from ScalaCheck i was looking for generating parallel command sequences. Is it supported?
The text was updated successfully, but these errors were encountered: