[erlang-questions] Proper/EQC parallel statem test question

Torben Hoffmann torben.lehoff@REDACTED
Wed Dec 5 09:22:06 CET 2012

Hi Gleb,

On 2012-12-04 22:12, Gleb Peregud wrote:
> Hi list!
> Does postcondition of the statem test has to be a pure function? Is it
> OK to do a request to a processe of the tested system from
> postcondition like I do here [1] ?
If you have a sufficiently complicated system you might have to do a 
number of things to validate what you have done is actually correct, so 
I think what you are doing is in principle okay.

The trick is that you have make sure that you are fully done with a test 
step before you proceed.

To exemplify what you might have to deal with: I had a system where I 
had to observe multiple messages in the system to be sure that 
everything was okay. For that I spawned a process for each message and 
if the message occoured before some reasonable timeout the process 
reported true back to a collector process. The collector process checked 
all responses and replied back to the test.
That worked. I knew how long it was reasonable to wait and then I could 
introduce the synchronisation point needed by - in my case - QuickCheck.

> This becomes a problem for me when running degenerated parallel test
> where commands seems to be run in a single process, while
> postcondition is being checked in another test. Example:
> Sequential part:
> [actor_up(v01),
> actor_up(v02)]
> Parallel part:
> Process one: []
> Process two: [
>   actor_search(v01),
>   actor_search(v02)]
> So essentially it is still a sequential test, since only one of the
> two parallel testers is running any code. But due to postconditions of
> actor_search operation being run in yet another process (probably main
> test process) they are getting mixed up.
This I do not understand - could you elaborate on what is going on?


> Thanks!
> Gleb
> P.S. This is an academic project, hence I am using Proper and can't
> test if it behaves differently in full version EQC.
> 1: https://github.com/gleber/dstree/blob/master/test/dstree_statem.erl#L129
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions


More information about the erlang-questions mailing list