getsentry / getsentry/sentry

Flaky test: tests/sentry/incidents/serializers/test_workflow_engine_incident.py::TestIncidentSerializer::test_detailed

Open
#108,918 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_incident.py::TestIncidentSerializer::test_detailed
Sentry sha: 4a8dadc9c184ad93a761561c5f57437a29cd3300
Run: https://github.com/getsentry/sentry/actions/runs/22283663600

tests/sentry/incidents/serializers/test_workflow_engine_incident.py:54: in test_detailed
    assert serialized_incident == self.incident_expected
E   AssertionError: assert {'activities'...one.utc), ...} == {'activities'...one.utc), ...}
E     
E     Omitting 14 identical items, use -vv to show
E     Differing items:
E     {'alertRule': {'aggregate': 'count()', 'createdBy': None, 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tz...datetime.timezone.utc), 'dateModified': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc), ...}} != {'alertRule': {'aggregate': 'count()', 'createdBy': None, 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tz...datetime.timezone.utc), 'dateModified': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc), ...}}
E     
E     Full diff:
E       {
E           'activities': None,
E           'alertRule': {
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': '82',
E               'name': 'Enabled Seagull',
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': '58',
E     +                         'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     +                         'desc': 'Send a notification to admin@localhost',
E     +                         'id': '54',
E     +                         'inputChannelId': None,
E     +                         'integrationId': None,
E     +                         'priority': None,
E     +                         'sentryAppId': None,
E     +                         'targetIdentifier': '1970',
E     +                         'targetType': 'user',
E     +                         'type': 'email',
E     +                     },
E     +                 ],
E     +                 'alertRuleId': '82',
E     +                 'alertThreshold': 50,
E     +                 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     +                 'id': '58',
E     +                 'label': 'warning',
E     +                 'resolveThreshold': 50,
E     +                 'thresholdType': 0,
E     +             },
E     +             {
E     +                 'actions': [
E     +                     {
E                               'alertRuleTriggerId': '57',
E                               'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E                               'desc': 'Send a notification to admin@localhost',
E                               'id': '53',
E                               'inputChannelId': None,
E                               'integrationId': None,
E                               'priority': None,
E                               'sentryAppId': None,
E                               'targetIdentifier': '1970',
E                               'targetType': 'user',
E                               'type': 'email',
E                           },
E                       ],
E                       'alertRuleId': '82',
E                       'alertThreshold': 100,
E                       'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E                       'id': '57',
E                       'label': 'critical',
E                       'resolveThreshold': 50,
E                       'thresholdType': 0,
E                   },
E     -             {
E     -                 'actions': [
E     -                     {
E     -                         'alertRuleTriggerId': '58',
E     -                         'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     -                         'desc': 'Send a notification to admin@localhost',
E     -                         'id': '54',
E     -                         'inputChannelId': None,
E     -                         'integrationId': None,
E     -                         'priority': None,
E     -                         'sentryAppId': None,
E     -                         'targetIdentifier': '1970',
E     -                         'targetType': 'user',
E     -                         'type': 'email',
E     -                     },
E     -                 ],
E     -                 'alertRuleId': '82',
E     -                 'alertThreshold': 50,
E     -                 'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E     -                 'id': '58',
E     -                 'label': 'warning',
E     -                 'resolveThreshold': 50,
E     -                 'thresholdType': 0,
E     -             },
E               ],
E           },
E           'dateClosed': None,
E           'dateCreated': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E           'dateDetected': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E           'dateStarted': datetime.datetime(2024, 12, 11, 3, 21, 34, tzinfo=datetime.timezone.utc),
E           'discoverQuery': '(event.type:error) AND (level:error)',
E           'id': '24',
E           'identifier': '1',
E           'organizationId': '4555195392327680',
E           'projects': [
E               'bar',
E           ],
E           'status': 20,
E           'statusMethod': 3,
E           'title': 'Hello world',
E           'type': 2,
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 with tests/sentry/incidents/serializers/test_workflow_engine_incident.py::TestIncidentSerializer::test_detailed and reproduce the failure from the linked Actions run. Inspect the full assertion diff, especially the alertRule triggers and actions ordering. Done means the test passes reliably without depending on intermittent serialized output ordering.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.