better emulation of connections in gossip tests
better emulation of connections in gossip tests

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.

n054/weave,paulbellamy/weave,tomwilkie/weave,n054/weave,dpw/weave,weaveworks/weave,n054/weave,n054/weave,weaveworks/weave,rade/weave,tomwilkie/weave,aaam/weave,n054/weave,tomwilkie/weave,rade/weave,weaveworks/weave,paulbellamy/weave,tomwilkie/weave,paulbellamy/weave,rade/weave,weaveworks/weave,dpw/weave,aaam/weave,aaam/weave,rade/weave,dpw/weave,dpw/weave,rade/weave,dpw/weave,aaam/weave,paulbellamy/weave,tomwilkie/weave,aaam/weave