mirror of
https://github.com/lightninglabs/loop
synced 2024-11-09 19:10:47 +00:00
3be5a37cd3
This failure became normal recently: === RUN TestAutoLoopInEnabled autoloop_testcontext_test.go:318: Error Trace: /home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318 /home/runner/work/loop/loop/liquidity/autoloop_test.go:804 Error: Not equal: expected: 80000 actual : 160000 Test: TestAutoLoopInEnabled autoloop_testcontext_test.go:318: Error Trace: /home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318 /home/runner/work/loop/loop/liquidity/autoloop_test.go:804 Error: Not equal: expected: 160000 actual : 80000 Test: TestAutoLoopInEnabled autoloop_testcontext_test.go:343: Error Trace: /home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:343 /home/runner/work/loop/loop/liquidity/autoloop_test.go:804 Error: Should be true Test: TestAutoLoopInEnabled The root cause is them the order of items in c.quoteRequestIn depends on the order of loopInBuilder.buildSwap calls, which depends on the order of channel handling in Manager.SuggestSwaps, which depends on the order of map traversal, which is not determitistic. Since in the test all the amounts are different, I used amount as a key and put the expected calls into a map using amount as a key. When I extract an item from c.quoteRequestIn channel, I find the corresponding item in the map and remove it. All other logic is preserved. |
||
---|---|---|
.. | ||
autoloop_test.go | ||
autoloop_testcontext_test.go | ||
balances.go | ||
fees.go | ||
interface.go | ||
liquidity_test.go | ||
liquidity.go | ||
log.go | ||
loopin_builder_test.go | ||
loopin_builder.go | ||
loopin.go | ||
loopout_builder.go | ||
loopout.go | ||
mock.go | ||
parameters_test.go | ||
parameters.go | ||
reasons.go | ||
restrictions.go | ||
threshold_rule_test.go | ||
threshold_rule.go |