Skip to content

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

@linh-tran-mobosurvey

Description

@linh-tran-mobosurvey

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions