-
Notifications
You must be signed in to change notification settings - Fork 25
bracketP doesn't work #159
Comments
Yeah, I recall that I couldn't get clean up to work properly, probably because of the reasons you explained. Thanks for looking into it. I think both options might be desirable and it would be nice if we had an example of each approach. Perhaps |
It's a good idea to demonstrate both. Now, it looks like the current specifications for these web servers cannot be parallelized. For instance, a simple counterexample for the |
If we make the server implementation use By the way, this example was inspired by: https://github.com/Quviq/QuickCheckExamples/blob/master/src/crud_eqc.erl . |
There could be a concurrent There are a few points I'd like to ask about in the testing process for parallel programs.
|
Ah yes, I now remember a discussion with @Danten where he raised a similar point about the Erlang example. I don't think we came to any satisfactory conclusion about how the Erlang version works. Do note that there is a bunch of This leads to your second question. Perhaps the model should be shared when we generate the suffixes, and not independent like it is now? I don't think that makes sense though, because we don't know how the threads are scheduled or how long the operations take to execute. I think instead what we need to do is to generalise histories. This is getting a bit off topic for this issue, so I'll create a new one. |
Thanks for your answer! I'll keep looking at the literature surrounding the topic and see whether anything interesting comes up. |
Started a bit on this in the |
Current source of
bracketP
return . prop
never fails, so the finalizer is never run. UsingbracketOnError
seems also strange. Most of the time we want to clean up resources regardless of whether the bracketed operation fails (usebracket
instead). Ultimately I don't thinkbracketP
on properties is actually needed, it operates at the wrong level of abstraction.A consequence of its current behavior is that the CrudWebserver examples spawn servers without killing them. When the
setup
action is run (once per test case), I believe the following happens:the first call binds a constant port (8080, 8081 or 8082 depending on the test case);
in all the others calls the new server dies because the first one is still living and using that port, but
setup
still returns happily.Nothing
and assume the server is fine.Thus tests continue talking with the first server, which carries data from previous runs. Tests still succeed because the preconditions in the model prevent reading data that the current test case has not (over)written.
I think there are two options here, and in both cases a simple
bracket
would be sufficient:StateMachine
runner, rather than a bracket around the toplevelprop_*
properties.Any preference for fixing the CrudWebserver examples?
The text was updated successfully, but these errors were encountered: