apple / swift-cluster-membership

Distributed Membership Protocol implementations in Swift
https://apple.github.io/swift-cluster-membership/
Apache License 2.0
201 stars 20 forks source link

Test nack handling in NIOShell #45

Closed avolokhov closed 4 years ago

avolokhov commented 4 years ago

We have a few tests checking that if onEveryPingRequestResponse is called, LHM will be adjusted accordingly. This tests will ensure that SWIMNIOShell properly propagates ping request responses and call onEveryPingRequestResponse on every PingRequestResponse

Motivation:

Tests are nice.

Modifications:

SWIMNIOEmbeddedTests will have some additional helper methods and a few new tests checking .nack handling

Result:

avolokhov commented 4 years ago

Saw one quick follow up I can make.

ktoso commented 4 years ago

Failure was warning on 5.3:

02:23:25 /code/Tests/SWIMTests/SWIMInstanceTests.swift:731:9: error: using '_' to ignore the result of a Void-returning function is redundant
02:23:25         _ = swim.onEveryPingRequestResponse(.nack(target: secondPeer, sequenceNumber: 1), pingedMember: secondPeer)
02:23:25         ^~~~