January 2019
Intermediate to advanced
376 pages
8h 49m
English
As with the last chapter, the parallel version of our system can be adapted by just declaring a new property and reusing the same model, to see if any glaring concurrency issue can be found.
You just have to add the parallel property to the same file:
| | Erlang code/Bookstore/erlang/bookstore/test/prop_bookstore.erl |
| | prop_parallel() -> |
| | ?SETUP(fun() -> |
| | {ok, Apps} = application:ensure_all_started(bookstore), |
| | fun() -> [application:stop(App) || App <- Apps], ok end |
| | end, |
| | ?FORALL(Cmds, parallel_commands(?MODULE), |
| | begin |
| | bookstore_db:setup(), |
| | {History, State, Result} = run_parallel_commands(?MODULE, Cmds), |
| | bookstore_db:teardown(), |
| | ?WHENFAIL(io:format("=======~n" |
| | "Failing command ... |
Read now
Unlock full access