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

Fix test memory usage (and speed?) #3115

Open
8 tasks
davidzwa opened this issue Apr 16, 2024 · 0 comments
Open
8 tasks

Fix test memory usage (and speed?) #3115

davidzwa opened this issue Apr 16, 2024 · 0 comments
Labels
epic Collection issue or big subproject. investigate Research the feasability

Comments

@davidzwa
Copy link
Collaborator

davidzwa commented Apr 16, 2024

Often when running tests (even more so with coverage or sqlite) the result can be a fatal Javascript heap out of memory error. This is not a problem per se, given we can increase this heap. But its definitely a nuisance. Furthermore, tests are slow to run. I believe this can be improved.

Task description

  • Investigate what the difference is between these scenarios
    • running a test without in-memory database
    • running a test with and without coverage
    • running a test without supertest and thus without server host
    • running an integration with and without awilix (Dependency Injection)
  • Profile the CPU and memory usage of a unit test, service test, db+integration test and db+api test
  • Commit these tests to a separate repository and create a follow-up issue to fire/report this on cron-based schedule
  • If any improvement can be found in tests, for example by deduplicating SQLite instances, merging tests or reducing to reduction in test scope (skipping a awilix+host setup) do it.

Special note

There seems to be more memory/CPU usage when either running SQLite mode, or test coverage - my intuition says that coverage is the challenge here.

@davidzwa davidzwa added bug Something isn't working investigate Research the feasability epic Collection issue or big subproject. and removed bug Something isn't working labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Collection issue or big subproject. investigate Research the feasability
Projects
None yet
Development

No branches or pull requests

1 participant