-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Another flaky test caused CI to [fail](https://github.com/cowprotocol/services/actions/runs/10723467528/job/29736827126?pr=2950) on an unrelated change (also worked locally). The test in question fails because no trade happens. After comparing the logs of a failed CI run with a successful local run it looks like the order in question never makes it into the auction because 1 of the native prices is always missing. The test actually sets up all the liquidity that is needed but in the failed run the solver was never able to compute a solution. The driver correctly found the existing pool it was supposed to use but apparently the driver's view of the pool was not up-to-date. As an optimization the driver is allowed to use stale liquidity data for quotes (but not for solving auctions). This was already the cause of flaky tests in the past and the fix was to keep mining new blocks until the driver flushes out the cached liquidity forcing it to see the latest state of the chain which then allows it to finally compute a native price. To make the whole thing work reliably in CI I also had to use a tokio runtime with 2 worker threads. # Changes * mine a bunch of blocks to flush out stale cached liquidity * also changed how we wait for the trade to happen since synchronizing on the size of the auction is prone to race * conditions * To test the change sufficiently I added a new opt-in flaky test runner that runs 1 test in a loop to see if it works. Also mentioned that in the readme. ## How to test Used new flaky test runner to run the test 500 times
- Loading branch information
1 parent
990ce6c
commit 6c73eb6
Showing
3 changed files
with
74 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters