Testing Parallel Executions
Understand the basics of parallel testing and how to debug the errors in the executions.
We'll cover the following...
Getting started
One of the most interesting features of stateful tests with PropEr is taking the models we write for sequential ones and automatically turning them into parallel tests that have a decent chance at finding concurrency bugs in our code at nearly no cost. It requires just a few minor changes to the property, and the rest is done for us.
The way it works is conceptually simple. The framework first takes the existing command generation mechanism and then builds a sequence. It should look something like the following in abstract terms:
It next picks a common root of operations. Let’s say in this case A -> B
is shared by all operations that follow them both. PropEr will take the remaining chain and split it up in concurrent timelines based on some elevated analysis, generating something like this:
This new sequence will be represented as a tuple of the form {SequentialRoot, [LeftBranch, RightBranch]}
. PropEr will run the common sequential root, and then run both alternative branches in parallel in an attempt to ...