You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Reload is set then the history doesn't get saved. Unfortunately for me it's not clear why this is happening, or if it's the intended way of working.
Basically when an expect is set while something is calling the function some calls will be dropped even though seems to me the expect is working. Seems like a race condition in this compiler handling part?
Expected behavior
I expect that the history contains all calls to the function
Observed behavior
Usually the first call immediately after setting the expect is dropped.
Versions
Meck version: 0.8.6
Erlang version: 17.5, 20
The text was updated successfully, but these errors were encountered:
Finally got around to looking at this today. I couldn't reproduce it with the simple test on my (faster?) machine, so I had to create this monster version:
I'm also not sure why the reload case is there, and why we don't store history while reloading is active (history is historical, so it should be stored regardless I think). By removing it, this test passes and it doesn't seem to break any other tests.
Hi,
I am trying to use num_calls with a mocked function, but some of the history gets dropped. I identified the problematic part, which is here:
https://github.com/eproxus/meck/blob/master/src/meck_proc.erl#L308-L315
If Reload is set then the history doesn't get saved. Unfortunately for me it's not clear why this is happening, or if it's the intended way of working.
Reproduction Steps
I put a test repo here:
https://github.com/luos/meck-test
The test can be found in here:
https://github.com/luos/meck-test/blob/master/test/mt_reload_test.erl
Basically when an expect is set while something is calling the function some calls will be dropped even though seems to me the expect is working. Seems like a race condition in this compiler handling part?
Expected behavior
I expect that the history contains all calls to the function
Observed behavior
Usually the first call immediately after setting the expect is dropped.
Versions
The text was updated successfully, but these errors were encountered: