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

Stubbing w/ more than 2 threads doesn't work #17

Open
linh-tran-mobosurvey opened this issue Jun 4, 2019 · 0 comments
Open

Stubbing w/ more than 2 threads doesn't work #17

linh-tran-mobosurvey opened this issue Jun 4, 2019 · 0 comments

Comments

@linh-tran-mobosurvey
Copy link

linh-tran-mobosurvey commented Jun 4, 2019

If you stub a function with 3 mocks e.g.

stub someFunc \
"echo 1 >> somefile.txt" \
"echo 2 >> somefile.txt" \
"echo 3 >> somefile.txt";
sut_dosomething_thatwillcall_someFunc;
unstub someFunc

This will work if [sut_dosomething_thatwillcall_someFunc] is single threated. However,
if [sut_dosomething_thatwillcall_someFunc] has 3 threads, each thread calls [someFunc] once, the 3rd mock will never be executed (the 2nd mock "echo 2..." gets executed repetitively).

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

1 participant