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

Refactor backend tests to allow parallelization #2924

Open
corneliusroemer opened this issue Oct 1, 2024 · 3 comments
Open

Refactor backend tests to allow parallelization #2924

corneliusroemer opened this issue Oct 1, 2024 · 3 comments
Labels
backend related to the loculus backend component feature Feature proposal tests Test related issues

Comments

@corneliusroemer
Copy link
Contributor

Would be nice if we could run backend tests in parallel, right now some tests seem to require an empty database which is problematic.

Related to #2710

@corneliusroemer corneliusroemer added backend related to the loculus backend component feature Feature proposal tests Test related issues labels Oct 1, 2024
@fengelniederhammer
Copy link
Contributor

I think the main point that needs to be answered here is whether we want:

  1. 100% reproducability of tests (because they always start with an empty DB)
  2. resilience and independence of the tests at the cost of reproducability (i.e. assuming that the DB is not empty and writing tests such that they still run green)
    • Advantage:
      • They might catch some more real-life bugs, because at runtime the DB also is not empty
      • you can run them in parallel
    • Disadvantage:
      • Tests in CI might fail, but it's not reproducable locally, since it might depend on the state of the DB.
      • Tests are maybe a bit harder to write, because they need to be such that they ignore already existing entries in the DB

I would also favor 2. I'm just saying it needs to be a conscious decision.

@corneliusroemer
Copy link
Contributor Author

Can't we just have a separate db for each test file, or for each process/thread? I don't understand enough (yet) about our setup, but that way it might be possible to avoid the (low) risk of issues (I've run tests in parallel and didn't see any issues, even without any extra db setup in the past).

@fengelniederhammer
Copy link
Contributor

I've never done test parallelization with gradle and testcontainers. I don't know how it would behave. And I can't judge which would be the easier approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend related to the loculus backend component feature Feature proposal tests Test related issues
Projects
None yet
Development

No branches or pull requests

2 participants