getsentry / getsentry/sentry

Flaky test: tests/sentry/uptime/endpoints/test_organization_uptime_alert_index.py::OrganizationUptimeAlertIndexEndpointTest::test

Open
#108,884 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/uptime/endpoints/test_organization_uptime_alert_index.py::OrganizationUptimeAlertIndexEndpointTest::test
Sentry sha: ab471d2d1ede60c8a8c1e3911b78a71a83261eae
Run: https://github.com/getsentry/sentry/actions/runs/22271636179

tests/sentry/uptime/endpoints/test_organization_uptime_alert_index.py:24: in test
    self.check_valid_response(resp, [alert_1, alert_2])
tests/sentry/uptime/endpoints/test_organization_uptime_alert_index.py:15: in check_valid_response
    assert [
E   AssertionError: assert [{'assertion'...opment', ...}] == [{'assertion'...opment', ...}]
E     
E     At index 0 diff: {'id': '1854', 'projectSlug': 'bar', 'environment': 'development', 'name': 'test1', 'status': 'active', 'uptimeStatus': <UptimeStatus.OK: 1>, 'mode': 3, 'owner': None, 'recoveryThreshold': 1, 'downtimeThreshold': 3, 'url': 'http://Wanted-Bedbug.com', 'method': 'GET', 'body': None, 'headers': [], 'intervalSeconds': 60, 'timeoutMs': 100, 'traceSampling': False, 'responseCaptureEnabled': True, 'assertion': None} != {'id': '1855', 'projectSlug': 'bar', 'environment': 'development', 'name': 'test2', 'status': 'active', 'uptimeStatus': <UptimeStatus.OK: 1>, 'mode': 3, 'owner': None, 'recoveryThreshold': 1, 'downtimeThreshold': 3, 'url': 'http://Mature-Clam.com', 'method': 'GET', 'body': None, 'headers': [], 'intervalSeconds': 60, 'timeoutMs': 100, 'traceSampling': False, 'responseCaptureEnabled': True, 'assertion': None}
E     
E     Full diff:
E       [
E     +     {
E     +         'assertion': None,
E     +         'body': None,
E     +         'downtimeThreshold': 3,
E     +         'environment': 'development',
E     +         'headers': [],
E     +         'id': '1854',
E     +         'intervalSeconds': 60,
E     +         'method': 'GET',
E     +         'mode': 3,
E     +         'name': 'test1',
E     +         'owner': None,
E     +         'projectSlug': 'bar',
E     +         'recoveryThreshold': 1,
E     +         'responseCaptureEnabled': True,
E     +         'status': 'active',
E     +         'timeoutMs': 100,
E     +         'traceSampling': False,
E     +         'uptimeStatus': <UptimeStatus.OK: 1>,
E     +         'url': 'http://Wanted-Bedbug.com',
E     +     },
E           {
E               'assertion': None,
E               'body': None,
E               'downtimeThreshold': 3,
E               'environment': 'development',
E               'headers': [],
E               'id': '1855',
E               'intervalSeconds': 60,
E               'method': 'GET',
E               'mode': 3,
E               'name': 'test2',
E               'owner': None,
E               'projectSlug': 'bar',
E               'recoveryThreshold': 1,
E               'responseCaptureEnabled': True,
E               'status': 'active',
E               'timeoutMs': 100,
E               'traceSampling': False,
E               'uptimeStatus': <UptimeStatus.OK: 1>,
E               'url': 'http://Mature-Clam.com',
E           },
E     -     {
E     -         'assertion': None,
E     -         'body': None,
E     -         'downtimeThreshold': 3,
E     -         'environment': 'development',
E     -         'headers': [],
E     -         'id': '1854',
E     -         'intervalSeconds': 60,
E     -         'method': 'GET',
E     -         'mode': 3,
E     -         'name': 'test1',
E     -         'owner': None,
E     -         'projectSlug': 'bar',
E     -         'recoveryThreshold': 1,
E     -         'responseCaptureEnabled': True,
E     -         'status': 'active',
E     -         'timeoutMs': 100,
E     -         'traceSampling': False,
E     -         'uptimeStatus': <UptimeStatus.OK: 1>,
E     -         'url': 'http://Wanted-Bedbug.com',
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 with tests/sentry/uptime/endpoints/test_organization_uptime_alert_index.py, especially test and check_valid_response. Run the named test repeatedly and compare the response ordering with [alert_1, alert_2]. Done means the test reliably passes without depending on nondeterministic alert ordering.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.