oncall-engine/engine/common/tests
Matias Bordese 1a8e4fef40
Update OrderedModel.swap to retry on IntegrityError (#3940)
Related to https://github.com/grafana/oncall-private/issues/2386.

Issue seems related to [multiple concurrent Terraform-triggered
updates](https://ops.grafana-ops.net/explore?schemaVersion=1&panes=%7B%22j0s%22:%7B%22datasource%22:%22000000193%22,%22queries%22:%5B%7B%22refId%22:%22B%22,%22expr%22:%22%7Bcluster%3D%5C%22prod-eu-west-0%5C%22,%20namespace%3D%5C%22amixr-prod%5C%22%7D%20%7C%3D%20%5C%22logger%3Dinsight_logger%20tenant_id%3D735393%5C%22%20%7C%3D%20%5C%22resource_type%3Droute%5C%22%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22000000193%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%221707813893526%22,%22to%22:%221707815856774%22%7D%7D%7D&orgId=1
) changing the route order to zero (and eventually succeeding)

Sample test run with the failing error:
```
========================================== short test summary info ===========================================
FAILED common/tests/test_ordered_model.py::test_ordered_model_swap_all_to_zero - assert not [DoesNotExist(), IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel...
======================================= 1 failed, 5 warnings in 34.39s =======================================
make: *** [Makefile:283: run-backend-test] Error 1
```
2024-02-22 20:51:05 +00:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
test_apply_jinja_template.py Add parse_json template function (#3929) 2024-02-20 10:29:03 -05:00
test_cache.py patch redis cluster multi-key operations (#3496) 2023-12-04 13:08:57 -05:00
test_create_engine_url.py Use utility function to create URLs 2022-07-12 15:42:20 -06:00
test_custom_fields.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
test_database.py Add utility function to get readonly db key if defined (#1264) 2023-02-01 12:07:32 +01:00
test_l10n.py add user locale field to mobile app user settings table + change going on call push notification text (#2131) 2023-06-14 12:19:58 -04:00
test_markup.py Fix cuddled list Markdown issue (#2488) 2023-07-11 09:14:52 +00:00
test_ordered_model.py Update OrderedModel.swap to retry on IntegrityError (#3940) 2024-02-22 20:51:05 +00:00
test_recaptcha.py Add validation of hostname for recapctha (#1445) 2023-03-06 08:59:48 +00:00
test_regex_replace.py linting and fixed test 2022-07-14 20:06:24 +10:00
test_task_queue_assignment.py add more logging on celery task retry (#3695) 2024-01-16 07:13:16 -05:00
test_timezones.py shift swap requests model + CRUD endpoints (#2597) 2023-07-21 19:35:19 +00:00
test_urlize.py Fix warnings when running backend tests (#2079) 2023-06-06 18:38:00 +00:00
test_urlvalidator_without_tld.py use CustomURLValidator in custom_button (#1398) 2023-03-23 12:21:17 +00:00
test_viewset_actions.py Make viewset actions more consistent (#2120) 2023-06-07 12:10:53 +00:00