mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
liquidity: add false-positive checks on autoloop tests
This commit is contained in:
parent
9847f3ab3b
commit
afca558817
1 changed files with 36 additions and 0 deletions
|
|
@ -344,6 +344,24 @@ func (c *autoloopTestCtx) autoloop(step *autoloopStep) {
|
|||
return c.manager.numActiveStickyLoops() == 0
|
||||
}, defaultEventuallyTimeout, defaultEventuallyInterval, "failed to"+
|
||||
" wait for sticky loop counter")
|
||||
|
||||
// Since we're checking if any false-positive swaps were dispatched we
|
||||
// need to give some time to autoloop to possibly dispatch them.
|
||||
select {
|
||||
case <-c.outRequest:
|
||||
c.t.Fatal("expected no more loopout requests")
|
||||
|
||||
case <-c.inRequest:
|
||||
c.t.Fatal("expected no more loopin requests")
|
||||
|
||||
case <-c.quoteRequestIn:
|
||||
c.t.Fatal("expected no more loopout quote requests")
|
||||
|
||||
case <-c.quoteRequest:
|
||||
c.t.Fatal("expected no more loopin quote requests")
|
||||
|
||||
case <-time.After(500 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
|
||||
// easyautoloop walks our test context through the process of triggering our
|
||||
|
|
@ -383,6 +401,24 @@ func (c *autoloopTestCtx) easyautoloop(step *easyAutoloopStep, noop bool) {
|
|||
actual.OutgoingChanSet,
|
||||
)
|
||||
}
|
||||
|
||||
// Since we're checking if any false-positive swaps were dispatched we
|
||||
// need to give some time to autoloop to possibly dispatch them.
|
||||
select {
|
||||
case <-c.outRequest:
|
||||
c.t.Fatal("expected no more loopout requests")
|
||||
|
||||
case <-c.inRequest:
|
||||
c.t.Fatal("expected no more loopin requests")
|
||||
|
||||
case <-c.quoteRequestIn:
|
||||
c.t.Fatal("expected no more loopout quote requests")
|
||||
|
||||
case <-c.quoteRequest:
|
||||
c.t.Fatal("expected no more loopin quote requests")
|
||||
|
||||
case <-time.After(500 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
|
||||
// matchLoopOuts checks that the actual loop out requests we got match the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue