Open rvangraan opened 11 months ago
Update: I've implemented a work-around that successfully avoids the massive test cases:
precondition(_, _,S = #{}, {call, _, Call, _}) when Call =:= tcp_send orelse Call =:= connect ->
Size = size(term_to_binary(S)),
case Size > ?MEGABYTE(?MAX_DEEP_STATE_SIZE_MB) of
true ->
io:format("\nState size: ~p exceeds maximum threshold of ~pMb attempting call ~300p. Skipping", [Size, ?MAX_DEEP_STATE_SIZE_MB,Call]);
false ->
ok
end,
Size < ?MEGABYTE(?MAX_DEEP_STATE_SIZE_MB);
precondition(_, _,_S = #{}, _call) ->
true.
Basically, the calls that result in deep state mutations have been limited by a precondition
that checks the size of the symbolic state.
Hi there,
I'm working on tests that rely on
proper_fsm
. I'm noticing thatproper_fsm:commands(?MODULE)
generates truly gigantic command sequences. I'm using a lot of inferred state, i.e. delayed symbolic evaluations to effect state and it seems that sometimes these things becoming recursive. With that I mean code like this, that uses symbolic functions to calculate state:Some of the more extreme examples (That don't blow up):
If I sample a few of the outputs, you'll see the delayed evaluation calls:
This code works fine for shorter sequences, but the generator produces gigantic examples, that literally causes my beam VM to run out of memory.
So is there a way to limit the size of these things?
Here is a (bigger) example. There is nothing wrong with this test case, it does what it's supposed to. The issue is that the generator produces much, much bigger ones.
Thanks!
R