getsentry / getsentry/sentry

Flaky test: tests/sentry/incidents/serializers/test_workflow_engine_detector.py::TestDetectorSerializer::test_simple

Open
#108,887 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

flaky-test Tests
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 23m
Merged PRs (30d)
607

Description

Failing test: tests/sentry/incidents/serializers/test_workflow_engine_detector.py::TestDetectorSerializer::test_simple
Sentry sha: ab471d2d1ede60c8a8c1e3911b78a71a83261eae
Run: https://github.com/getsentry/sentry/actions/runs/22271635213

tests/sentry/incidents/serializers/test_workflow_engine_detector.py:36: in test_simple
    assert serialized_detector == self.expected
E   AssertionError: assert {'aggregate':...one.utc), ...} == {'aggregate':...one.utc), ...}
E     
E     Omitting 16 identical items, use -vv to show
E     Differing items:
E     {'triggers': [{'actions': [{'alertRuleTriggerId': '30', 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzin... 'alertThreshold': 100, 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc), ...}]} != {'triggers': [{'actions': [{'alertRuleTriggerId': '29', 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzin..., 'alertThreshold': 50, 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc), ...}]}
E     
E     Full diff:
E       {
E           'aggregate': 'count()',
E           'createdBy': None,
E           'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E           'dateModified': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E           'description': '',
E           'detectionType': 'static',
E           'id': '141',
E           'name': 'Mighty Seal',
E           'organizationId': '4555195392327680',
E           'owner': None,
E           'projects': [
E               'bar',
E           ],
E           'query': 'level:error',
E           'resolution': 1.0,
E           'status': 0,
E           'thresholdPeriod': 1,
E           'timeWindow': 10.0,
E           'triggers': [
E     +         {
E     +             'actions': [
E     +                 {
E     +                     'alertRuleTriggerId': '30',
E     +                     'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     +                     'desc': 'Send a notification to admin@localhost',
E     +                     'id': '27',
E     +                     'inputChannelId': None,
E     +                     'integrationId': None,
E     +                     'priority': None,
E     +                     'sentryAppId': None,
E     +                     'targetIdentifier': '2598',
E     +                     'targetType': 'user',
E     +                     'type': 'email',
E     +                 },
E     +             ],
E     +             'alertRuleId': '141',
E     +             'alertThreshold': 50,
E     +             'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     +             'id': '30',
E     +             'label': 'warning',
E     +             'resolveThreshold': 50,
E     +             'thresholdType': 0,
E     +         },
E               {
E                   'actions': [
E                       {
E                           'alertRuleTriggerId': '29',
E                           'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E                           'desc': 'Send a notification to admin@localhost',
E                           'id': '26',
E                           'inputChannelId': None,
E                           'integrationId': None,
E                           'priority': None,
E                           'sentryAppId': None,
E                           'targetIdentifier': '2598',
E                           'targetType': 'user',
E                           'type': 'email',
E                       },
E                   ],
E                   'alertRuleId': '141',
E                   'alertThreshold': 100,
E                   'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E                   'id': '29',
E                   'label': 'critical',
E                   'resolveThreshold': 50,
E                   'thresholdType': 0,
E               },
E     -         {
E     -             'actions': [
E     -                 {
E     -                     'alertRuleTriggerId': '30',
E     -                     'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     -                     'desc': 'Send a notification to admin@localhost',
E     -                     'id': '27',
E     -                     'inputChannelId': None,
E     -                     'integrationId': None,
E     -                     'priority': None,
E     -                     'sentryAppId': None,
E     -                     'targetIdentifier': '2598',
E     -                     'targetType': 'user',
E     -                     'type': 'email',
E     -                 },
E     -             ],
E     -             'alertRuleId': '141',
E     -             'alertThreshold': 50,
E     -             'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     -             'id': '30',
E     -             'label': 'warning',
E     -             'resolveThreshold': 50,
E     -             'thresholdType': 0,
E     -         },
E           ],
E       }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running tests/sentry/incidents/serializers/test_workflow_engine_detector.py::TestDetectorSerializer::test_simple and compare serialized_detector with self.expected. Investigate the differing trigger entries and their ordering or values shown in the failure, then rerun the test repeatedly; done means the test passes consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.