Skip to content

PB-1575: make test larger and more flexible. #568

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

Closed
wants to merge 1 commit into from

Conversation

adk-swisstopo
Copy link
Member

The remove_expired_items cronjob frequently runs out of memory in INT and PROD. As we are considering improvements, we need a way to easily test them and profile memory usage. This change adds a remove_many_items method that allows easily changing how many test items are considered. We also add two tests exercising that new method with 10 items and 10 assets each with and without dry run.

From there we can easily get a very basic memory profile with something like this:

/bin/time -f %M pipenv run python3 app/manage.py test --verbosity=2 tests.tests_10.test_remove_expired_items

We will also probably tweak the exact number of items and assets later to match more realistic scenarios.

The remove_expired_items cronjob frequently runs out of memory in INT and PROD.
As we are considering improvements, we need a way to easily test them and profile
memory usage. This change adds a `remove_many_items` method that allows easily
changing how many test items are considered. We also add two tests exercising
that new method with 10 items and 10 assets each with and without dry run.

From there we can easily get a very basic memory profile with something like this:
```
/bin/time -f %M pipenv run python3 app/manage.py test --verbosity=2 tests.tests_10.test_remove_expired_items
```

We will also probably tweak the exact number of items and assets later to match more realistic scenarios.
@github-actions github-actions bot added the bug label Apr 22, 2025
@adk-swisstopo adk-swisstopo marked this pull request as draft April 23, 2025 07:33
@adk-swisstopo
Copy link
Member Author

Superseded by #569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant