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

run_parallel_commands doesn't handle exceptions in commands the same way run_commands does #224

Open
x4lldux opened this issue Mar 25, 2020 · 6 comments

Comments

@x4lldux
Copy link
Contributor

x4lldux commented Mar 25, 2020

When a command crashes during run_parallel_commands, the entire test just crashes also, whilerun_commands catches such a situation and returns a exception tuple as a result. Shouldn't they work the same way?

@kostis
Copy link
Collaborator

kostis commented Mar 25, 2020

Please submit a minimal test case that illustrates the issue.

@x4lldux
Copy link
Contributor Author

x4lldux commented Mar 25, 2020

I can, but it'll be in Elixir using PropCheck library (a thin wrapper around PropEr); my Erlang is not that strong. But I've traced the origin of it:

  • run_parallel_commands uses pmap to run commands in parallel, wrapped in execute,
  • execute is using apply BIF instead of safe_apply like run_commands does
  • pmap spawns process and awaits the answers,
  • spawned process catch any error, while executing the command, and send it as a message to pmap
  • when the message, pmap gets, is a crash it just rethrows it

So when a SUT has a crashes, run_commands will return {exception, _, _, _} tuple as a result, while run_parallel_commands just forwards the crash.

@kostis
Copy link
Collaborator

kostis commented Mar 25, 2020

I can, but it'll be in Elixir using PropCheck library (a thin wrapper around PropEr); my Erlang is not that strong.

Well, you've came to the PropEr (TM) repository. Here you have your chance to strengthen your Erlang skills ;-)

@x4lldux
Copy link
Contributor Author

x4lldux commented Mar 25, 2020

Well, you've came to the PropEr (TM) repository.

Which runs on a BEAM™ that supports many other languages. Here you have your chance to make us feel included ;)

x4lldux added a commit to x4lldux/proper that referenced this issue Mar 26, 2020
@x4lldux
Copy link
Contributor Author

x4lldux commented Mar 26, 2020

@kostis test case added, see commit x4lldux/proper@c932eef

@x4lldux
Copy link
Contributor Author

x4lldux commented Mar 26, 2020

Also, the docs for run_parallel_commands are missing the exception tuple as a valid result type and that's what is being returned when command raises during the sequential part.

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

No branches or pull requests

2 participants