Fix flaky test local_node_eth_flow_without_quote
#3953
Merged
+10
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Sometimes the test failed because the driver immediately returned the
DeadlineExceedederror after receiving the/settlerequest. This is very odd since the deadline is quite generous (5 blocks) and not much happens between picking the deadline and sending the request. We only do a few DB operations but they only take ~30ms while we only mine blocks every 200ms or so.After some debugging it became clear that the driver's and the autopilot's view of the current block are just different. When the autopilot picks the deadline block the driver has already seen a few more blocks. So when the request arrives at the driver it immediately aborts the submission.
Changes
So far only the driver has been using the new web socket based current_block_stream implementation which has way lower latency than the polling implementation. The fix was to make the orderbook and autopilot also use the ws stream to keep them in sync. With this change the flaky test runner was able to run without issues with even tighter deadlines than before (2 blocks instead of 5).
How to test
Run with flaky test runner