Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legacy solver setup for e2e tests #2284

Merged
merged 8 commits into from
Jan 17, 2024

Conversation

devanoneth
Copy link
Contributor

Description

Since the collocated driver upgrades, at Enso we've been running our e2e tests against quite an old version of this repo. These small changes would help us upgrade our services dependency to the latest commits.

Changes

  • Two new functions in the e2e setup module which help external solvers use the e2e test harness in their own codebases.
  • Increase solve-deadline to 11s from 2s so that external solvers have a more realistic duration to return a solution in e2e tests.

How to test

  1. Run existing e2e tests.
  2. Enso's e2e tests run correctly against this updated code.

@devanoneth devanoneth requested a review from a team as a code owner January 15, 2024 12:06
@devanoneth devanoneth force-pushed the feat/legacy-solver-e2e-setup branch from 9a19623 to 5dbe756 Compare January 15, 2024 12:24
Copy link
Contributor

@fleupold fleupold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 160 to 162
let solver_endpoint =
solver_endpoint.unwrap_or("http://localhost:8000/solve".parse().unwrap());
let solver_endpoint = start_legacy_solver(solver_endpoint).await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we make it slightly clearer that these two are quite different. One is the actual external legacy solver endpoint and one is the colocated legacy solver engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks. Fixed in latest commit.

@@ -91,7 +91,7 @@ impl<'a> Services<'a> {
"--auction-update-interval=1s".to_string(),
format!("--ethflow-contract={:?}", self.contracts.ethflow.address()),
"--skip-event-sync=true".to_string(),
"--solve-deadline=2s".to_string(),
"--solve-deadline=11s".to_string(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this isn't messing with our tests since baseline/naive return early and never use the full time? Otherwise we could also make it configurable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same though and wanted to confirm by running CI once before commenting. Indeed it looks like this would be an issue for us. The CI time went from ~5m to ~10m.
The reason is that even if the baseline solver is able to compute a solution way faster the driver delays the submission of the solution until shortly before the deadline in case the solution would start to revert at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I also figured it was a max time. But I checked back on the logic where you implemented this and, as you mentioned, I see the driver then delays until the end of the duration.

I would suggest to add a solve_deadline: Option<Duration> argument to start_autopilot, where it defaults to 2s if None. I feel like a separate function with only one difference is overkill but it would make the diff smaller. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case that you agree, I've committed this change now. Happy to change the approach if you want though.

@devanoneth
Copy link
Contributor Author

devanoneth commented Jan 17, 2024

Everything seems to be working except that GitHub CI doesn't read the FORK_URL secret because this is a PR from a fork. Locally the fork tests pass for me.

@MartinquaXD MartinquaXD merged commit 3e8db3f into cowprotocol:main Jan 17, 2024
7 of 8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2024
@devanoneth devanoneth deleted the feat/legacy-solver-e2e-setup branch January 17, 2024 17:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants