Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

better emulation of connections in gossip tests #1767

Merged
merged 3 commits into from
Dec 11, 2015

Conversation

rade
Copy link
Member

@rade rade commented Dec 8, 2015

Real Connections do not process gossip until after LocalPeer.AddConnection. mockChannelConnection wasn't behaving in that way, which resulted in some sporadic test failures since it would cause some gossip to get processed too early, which in turn would trigger gc of some of the just-received peers, which we would then find missing in the test assertions.

To fix this we introduce a latch on mockChannelConnection which closes when the remote end is ready to receive gossip. Effectively this emulates the entering of LocalConnection.receiveTCP after the call to AddConnection completes.

Unfortunately an open latch will cause sendPendingGossip to block. We get around that by abandoning checks in "half-connected" connection states.

Fixes #1765.

@rade rade force-pushed the 1765-test-gossip-surrogate-failure branch from 1b6d156 to 9c3edac Compare December 8, 2015 23:53
@bboreham bboreham added this to the 1.5.0 milestone Dec 9, 2015
real Connections do not process gossip until after AddConnection.
mockChannelConnection wasn't behaving in that way, which resulted in
some sporadic test failures since it would cause some gossip to get
processed too early, which in turn would trigger gc of some of the
just-received peers, which we would then find missing in the test
assertions.

To fix this we introduce a latch on mockChannelConnection which closes
when the remote end is ready to receive gossip. Effectively this
emulates the entering of LocalConnection.receiveTCP after the call to
AddConnection completes.

Unfortunately an open latch will cause sendPendingGossip to block. We
get around that by abandoning checks in "half-connected" connection
states.

Fixes #1765.
@rade rade force-pushed the 1765-test-gossip-surrogate-failure branch from 9c3edac to ab902b4 Compare December 10, 2015 10:56
@bboreham bboreham modified the milestones: 1.4.1, 1.5.0 Dec 10, 2015
@bboreham bboreham self-assigned this Dec 11, 2015
@bboreham
Copy link
Contributor

You've removed all testing of one-sided connections? I guess that's what the last paragraph of your description says.

@bboreham bboreham modified the milestones: 1.4.0, 1.4.1 Dec 11, 2015
bboreham added a commit that referenced this pull request Dec 11, 2015
…ailure

better emulation of connections in gossip tests. Fixes #1765.
@bboreham bboreham merged commit b51b1ad into master Dec 11, 2015
@rade rade deleted the 1765-test-gossip-surrogate-failure branch December 31, 2015 15:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sporadic TestGossipSurrogate failure
2 participants