Closed thomaseizinger closed 3 weeks ago
Thanks for the feedback. I'll be doing some triaging this weekend after being away for a bit and will take a look at what this may entail. Do you have a workaround you're currently using or is this an active thorn in your side?
Thanks for the feedback. I'll be doing some triaging this weekend after being away for a bit and will take a look at what this may entail. Do you have a workaround you're currently using or is this an active thorn in your side?
Not really using a workaround at the moment. We usually turn up logs of the production code which often contains the same, useful values (like domains & IPs in this case).
This isn't very critical but more a QoL thing as you tagged it as!
Perhaps I can hijack this thread to ask a question on whether we are doing things correctly. Looking at some of the code that proptest-state-machine
executes, it looks like I should be able to directly return transitions that are based off the current state:
There are two problems with this:
ReferenceStateMachine::transitions
doesn't allow returning borrowed data from Self::State
, requiring lots of cloningIf a transition could reference the current state and as in the above example, just select a DNS server or a domain, then this issue would also be resolved.
Do you have a workaround you're currently using or is this an active thorn in your side?
I noticed that one way of working around this could be to override test_sequential
on StateMachineTest
.
We've moved away from indices in most places, making this problem go away.
We are making heavy uses of
sample::Index
to deterministically access state as part of our transitions. This works well functionally but makes debugging difficult because it obfuscates, what the transition actually does.The above is a transition that simulates sending a DNS query to a system but the domain that is being queried and which server it uses are part of the state and thus determined as part of applying the transition.
It would be useful if the transitions would have to implement a specialised
Debug
trait that gives access to the current state and allowed resolving these indices to the actual value it is being applied.