Skip to content
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 crash fix, #224 #227

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

x4lldux
Copy link
Contributor

@x4lldux x4lldux commented Mar 26, 2020

Fix for #224

@x4lldux
Copy link
Contributor Author

x4lldux commented Mar 29, 2020

@kostis it's no longer WIP and is ready for review.

@kostis
Copy link
Collaborator

kostis commented Apr 1, 2020

Thanks for the #224 issue and this PR. If all goes well, I will look into this before the end of the week.

In the meantime, you may want to correct an erroneous any that should read term() in the return of execute/3,

Typespec of `proper_statem:execute/3` had to be changed to return an
ok|error tuple so the older test had to be adjusted as well.
@kostis
Copy link
Collaborator

kostis commented Apr 28, 2020

OK, it took longer than expected because in the meantime I decided to first increase the test suite coverage and then to fix two statem tests to actually test what they are supposed to, but now I have looked at this.

Long story short: I do not (fully) understand the issue and I have doubts that the test shows what you think it shows. I would like to see a test where a property like this one

prop_exception() ->
    ?FORALL(Cmds, commands(?MODULE),
	    begin
		{_History,_State,Result} = run_commands(?MODULE, Cmds),
		Result =:= ok
	    end).

fails because Result is not ok but an {exception,_,_,_} tuple, while this property

prop_parallel_exception() ->
    ?FORALL(Cmds, parallel_commands(?MODULE),
	    begin
		{_History,_State,Result} = run_parallel_commands(?MODULE, Cmds),
		Result =:= ok
	    end).

does not do what it is supposed to because of an exception, but it does with the PR that fixes the issue reported in #241.

Note the crucial difference in what I am suggesting and what this PR contains as test: run_parallel_commands/2 is supposed to be run with a pair containing a list of lists of commands in its 2nd element (as produced by parallel_commands/1) while the 2nd arg of run_commands/2 takes as input just a list of commands (as produced by commands/1).

Please supply the test case first that shows what goes wrong without this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants