Merge pull request #4270 from filecoin-project/steb/test-fix-paychstatus-race

fix a race in the payment channel status test
This commit is contained in:
Steven Allen 2020-10-09 13:22:16 -07:00 committed by GitHub
commit a5c78371fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,13 +121,13 @@ func TestPaymentChannelStatus(t *testing.T) {
create := make(chan string)
go func() {
// creator: paych add-funds <creator> <receiver> <amount>
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)