Merge pull request #4110 from halseth/itest-abandonchannel-flake

itest: wait for file writing in wait predicate
This commit is contained in:
Oliver Gugger 2020-03-24 15:33:37 +01:00 committed by GitHub
commit 4726c674db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12717,12 +12717,16 @@ func testAbandonChannel(net *lntest.NetworkHarness, t *harnessTest) {
}
// Make sure the channel is no longer in the channel backup list.
err = wait.Predicate(func() bool {
bkupAfter, err := ioutil.ReadFile(net.Alice.ChanBackupPath())
if err != nil {
t.Fatalf("could not get channel backup before abandoning "+
"channel: %v", err)
t.Fatalf("could not get channel backup before "+
"abandoning channel: %v", err)
}
if len(bkupAfter) >= len(bkupBefore) {
return len(bkupAfter) < len(bkupBefore)
}, defaultTimeout)
if err != nil {
t.Fatalf("channel wasn't removed from channel backup file")
}