In our payment lifecycle tests, we have two goroutines that compete for the lock in our mock control tower: the resumePayment loop which tries to call RegisterAttempt, and the collectResult handler which is launched in a goroutine by collectResultAsync and is responsible for various settle/fail calls. The order that the lock is acquired by these goroutines is arbitrary, and can lead to flakes in our tests if the step that we do not intend to execute first gets the lock (eg, we want to fail a payment in collectResult, but RegisterAttempt gets there first). This commit moves contention for this lock after our mock's various "state driving" channels, so that the lock will be acquired in the order that the test intends it.
routing
The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.
Installation and Updating
⛰ go get -u github.com/lightningnetwork/lnd/routing