test: remove many sleeps from integration test by using new topology ntfns
This commit removes a number of sleeps from the set of current integration tests by replacing them with a synchronous (w/ a timeout) block until one or many channels are detected as being open within the network. As a result, the tests are now more robust, many flakes have been eliminated, and finally this shaves a few second off of the integration testing runs.
This commit is contained in:
2 files changed
+97
-80
No files matched your search
+2
-2
@@ -1686,7 +1686,7 @@ func (r *rpcServer) SubscribeChannelGraph(req *lnrpc.GraphTopologySubscription,
|
||||
// notifications from the channel router.
|
||||
client, err := r.server.chanRouter.SubscribeTopology()
|
||||
if err != nil {
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Ensure that the resources for the topology update client is cleaned
|
||||
@@ -1697,7 +1697,7 @@ func (r *rpcServer) SubscribeChannelGraph(req *lnrpc.GraphTopologySubscription,
|
||||
select {
|
||||
|
||||
// A new update has been sent by the channel router, we'll
|
||||
// marshall it into the form expected by the gRPC client, then
|
||||
// marshal it into the form expected by the gRPC client, then
|
||||
// send it off.
|
||||
case topChange, ok := <-client.TopologyChanges:
|
||||
// If the second value from the channel read is nil,
|
||||
|
||||
Reference in new issue
Block a user