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

load tests fail obscurely when nix dependencies change #2308

Closed
1 of 3 tasks
robx opened this issue Jun 9, 2022 · 2 comments
Closed
1 of 3 tasks

load tests fail obscurely when nix dependencies change #2308

robx opened this issue Jun 9, 2022 · 2 comments
Labels
ci Related to CI setup

Comments

@robx
Copy link
Contributor

robx commented Jun 9, 2022

The Loadtest (Nix) CI check compares Postgrest versions on the main and PR branches. If the nix dependencies are changed in a PR, this will typically cause build failures of the main branch, causing the check to fail.

E.g., in PRs #2306 and #2292, we've seen the Loadtest (Nix) CI check failing with

Running loadtest on "main"...
2022/06/07 23:54:11 encode: can't detect encoding of "stdin"
Error: Process completed with exit code 1.

(e.g. here: https://github.com/PostgREST/postgrest/runs/6784583539?check_suite_focus=true)

  • improve the test output so that it's clear what's happening nix: more explicit logging in load test #2309
  • skip the CI check or make it optional when the cabal file changes
  • (stretch goal) fix the load test to work even when dependencies change
robx added a commit to robx/postgrest that referenced this issue Jun 9, 2022
* Write vegeta output to file explicitly.
  The previous version using `tee` captured the standard
  output of the `withPgrst` helper, too, causing weird
  errors when those had unexpected output.

* Log and fail the postgrest build explicitly.
  In situations such as changing nix dependencies, the
  `cabal build` run could fail, but this wasn't visible
  in CI.

With these changes, the load test now fails with a nice
error message when the build fails.
robx added a commit to robx/postgrest that referenced this issue Jun 9, 2022
* Write vegeta output to file explicitly.
  The previous version using `tee` captured the standard
  output of the `withPgrst` helper, too, causing weird
  errors when those had unexpected output.

* Log and fail the postgrest build explicitly.
  In situations such as changing nix dependencies, the
  `cabal build` run could fail, but this wasn't visible
  in CI.

With these changes, the load test now fails with a nice
error message when the build fails.
@wolfgangwalther
Copy link
Member

I observed this earlier (didn't bother to look it up when and where) and came to the conclusion that this is unavoidable, basically.

IIRC when the cabal file changes, this will be the consequence - and it's perfectly fine. The idea for the loadtest is to compare code the code we have written and the impact it has on performance. It is not meant to test performance of dependencies or performance in any setting close to reality. It's quite artificial in fact.

I think what we should do is: Run the loadtest conditionally and only when the cabal file does not change - i.e. we don't have a dependency update. We just need to make sure that our PRs are either dependency updates or changes to actual code. Then, it would be absolutely fine to just not run the loadtest for dependency updates.

@wolfgangwalther wolfgangwalther added the ci Related to CI setup label Jun 9, 2022
@robx
Copy link
Contributor Author

robx commented Jun 9, 2022

@wolfgangwalther Thanks, yes that makes sense. I'll update the issue accordingly. Also thanks for review on #2309!

robx added a commit to robx/postgrest that referenced this issue Jun 14, 2022
This allows running the load test against main even if the
dependencies change.
robx added a commit to robx/postgrest that referenced this issue Jun 14, 2022
This allows running the load test against main even if the
dependencies change.
@robx robx closed this as completed in 0c5d2e5 Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to CI setup
Development

No branches or pull requests

2 participants