From e7950139f3a0ed1c5425aedf856d23d4e7b92e58 Mon Sep 17 00:00:00 2001 From: Vadim Stepanov Date: Thu, 27 Apr 2023 17:41:36 +0100 Subject: [PATCH] Fix flaky Slack test (#1841) # What this PR does Fix [flaky test](https://github.com/grafana/oncall/actions/runs/4821277510/jobs/8586941639#step:5:706) `test_get_user_groups_filter_by_handle` using `UniqueFaker` on `SlackUserGroupFactory.handle` to make handles always unique. Before: ```shell >>> len(set([SlackUserGroupFactory().handle for _ in range(100)])) 93 ``` After: ```shell >>> len(set([SlackUserGroupFactory().handle for _ in range(100)])) 100 ``` ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- engine/apps/slack/tests/factories.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/apps/slack/tests/factories.py b/engine/apps/slack/tests/factories.py index 77506fc0..fc6cf2dc 100644 --- a/engine/apps/slack/tests/factories.py +++ b/engine/apps/slack/tests/factories.py @@ -32,7 +32,7 @@ class SlackUserIdentityFactory(factory.DjangoModelFactory): class SlackUserGroupFactory(factory.DjangoModelFactory): slack_id = UniqueFaker("word") name = factory.Faker("word") - handle = factory.Faker("word") + handle = UniqueFaker("word") class Meta: model = SlackUserGroup