From b2d941ebfb6965fc180afe95c323b1ee90400f27 Mon Sep 17 00:00:00 2001 From: carla Date: Fri, 23 Apr 2021 08:39:38 +0200 Subject: [PATCH] routing/test: remove test channel buffers Now that we run each test individually, we don't need to buffer our mock's channels anymore. This helps to tighten our test loop, which currently can move on from a step before it's actually been processed by the mock. This removal ensures that our payment loop processes each of the test's steps before moving on to the next once. --- routing/payment_lifecycle_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/routing/payment_lifecycle_test.go b/routing/payment_lifecycle_test.go index d30ca02c..62c85c36 100644 --- a/routing/payment_lifecycle_test.go +++ b/routing/payment_lifecycle_test.go @@ -598,12 +598,12 @@ func testPaymentLifecycle(t *testing.T, test paymentLifecycleTestCase, // Create a mock control tower with channels set up, that we use to // synchronize and listen for events. control := makeMockControlTower() - control.init = make(chan initArgs, 20) - control.registerAttempt = make(chan registerAttemptArgs, 20) - control.settleAttempt = make(chan settleAttemptArgs, 20) - control.failAttempt = make(chan failAttemptArgs, 20) - control.failPayment = make(chan failPaymentArgs, 20) - control.fetchInFlight = make(chan struct{}, 20) + control.init = make(chan initArgs) + control.registerAttempt = make(chan registerAttemptArgs) + control.settleAttempt = make(chan settleAttemptArgs) + control.failAttempt = make(chan failAttemptArgs) + control.failPayment = make(chan failPaymentArgs) + control.fetchInFlight = make(chan struct{}) // setupRouter is a helper method that creates and starts the router in // the desired configuration for this test.