-
Notifications
You must be signed in to change notification settings - Fork 86
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
Connection manager transition order test using IOSimPOR #3640
Conversation
case connState of | ||
ReservedOutboundState -> do | ||
let connState' = UnnegotiatedState provenance connId connThread | ||
writeTVar connVar connState' | ||
return ( Just $ mkTransition connState connState' | ||
, Nothing | ||
) | ||
TerminatingState {} -> | ||
return (Nothing, Nothing) | ||
TerminatedState {} -> | ||
return (Nothing, Nothing) | ||
_ -> | ||
return ( Nothing | ||
, Just (CM.TrUnexpectedlyFalseAssertion | ||
(RequestOutboundConnection | ||
(Just connId) | ||
(abstractState (Known connState)) | ||
) | ||
) | ||
) | ||
|
||
traceWith trTracer (TransitionTrace peerAddr trans) | ||
traverse_ (traceWith trTracer . TransitionTrace peerAddr) trans | ||
traverse_ (traceWith tracer >=> evaluate . assert True) | ||
mbAssertion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, is there an open issue for this found bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, instead I just added io-sim-discovered
flag to this PR, there's just one bug which is described in the commit so it's should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄
Using *IOSimPOR*.
When we fork outbound connection handler we need to update the state to `UnnegotiatedState`, but we should not do that blindly. It could happen that the connection broke and was put in `TerminatedState` (or `TerminatingState`) in the meantime by the connection handler thread. This bug was discovered by *IOSimPOR*.
44f0d8c
to
4a0b181
Compare
bors merge |
Build succeeded: |
3640: Connection manager transition order test using IOSimPOR r=coot a=coot This PR adds a quickcheck property test which validates order of connection manager transitions using *IOSimPOR*. It also fixes a connection manager bug discovered thanks to the new test. Fixes #3613. - connection-manager-tests: test transition order - connection-manager: don't blindly override state - connection-manager-tests: code style 3662: Removed ST effects from IOSimPOR r=coot a=coot ST effects are thread local, they never race with other steps. This patch reverts a previous fix commited in PR #3647. Thanks for `IOSimPOR` we also found out that the transition: `UnnegotiatedSt Inbound → TerminatingSt` should be valid, similarly to one for outbound connections (see PR #3652, commit fbcb6aa). Co-authored-by: Marcin Szamotulski <[email protected]>
This PR adds a quickcheck property test which validates order of connection manager transitions using IOSimPOR. It also fixes a connection manager bug discovered thanks to the new test.
Fixes #3613.