From 9f9d5cb2a5645e16e269160f32852537c9502094 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 9 Oct 2020 11:50:16 -0700 Subject: [PATCH] fix a race in the payment channel status test We should not be clobbering the cmd variable. --- cli/paych_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/paych_test.go b/cli/paych_test.go index 2aa5c6009..862ca2e74 100644 --- a/cli/paych_test.go +++ b/cli/paych_test.go @@ -121,13 +121,13 @@ func TestPaymentChannelStatus(t *testing.T) { create := make(chan string) go func() { // creator: paych add-funds - cmd = []string{creatorAddr.String(), receiverAddr.String(), fmt.Sprintf("%d", channelAmt)} + cmd := []string{creatorAddr.String(), receiverAddr.String(), fmt.Sprintf("%d", channelAmt)} create <- creatorCLI.runCmd(paychAddFundsCmd, cmd) }() // Wait for the output to stop being "Channel does not exist" for regexp.MustCompile(noChannelState).MatchString(out) { - cmd = []string{creatorAddr.String(), receiverAddr.String()} + cmd := []string{creatorAddr.String(), receiverAddr.String()} out = creatorCLI.runCmd(paychStatusByFromToCmd, cmd) } fmt.Println(out)