openedx / openedx/openedx-platform
[Flaky test] `openedx/features/enterprise_support/tests/test_utils.py::TestEnterpriseUtils::test_enterprise_customer_for_request_called_on_404_2____dashboard___1_`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
This test fails intermittently and has been deleted according to the Flaky Test Process in https://github.com/openedx/edx-platform/pull/24262
See docs on how to address flaky tests for why this should be fixed and how to go about it.
The removed test fails in: https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/3656/ and https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/3660/
Failure output:
Error Message
AssertionError: 0 != 1
Stacktrace
self = <openedx.features.enterprise_support.tests.test_utils.TestEnterpriseUtils testMethod=test_enterprise_customer_for_request_called_on_404_2____dashboard___1_>
resource = '/dashboard', expected_calls = 1
@ddt.data(
('notfoundpage', 0),
(reverse('dashboard'), 1),
)
@ddt.unpack
def test_enterprise_customer_for_request_called_on_404(self, resource, expected_calls):
"""
Test enterprise customer API is not called from 404 page
"""
self.client.login(username=self.user.username, password='password')
with mock.patch(
'openedx.features.enterprise_support.api.enterprise_customer_for_request'
) as mock_customer_request:
self.client.get(resource)
> self.assertEqual(mock_customer_request.call_count, expected_calls)
E AssertionError: 0 != 1
openedx/features/enterprise_support/tests/test_utils.py:46: AssertionError
Migrated from private ticket https://2u-internal.atlassian.net/issues/CR-2337
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with openedx/features/enterprise_support/tests/test_utils.py and the removed test named TestEnterpriseUtils::test_enterprise_customer_for_request_called_on_404_2____dashboard___1_. Review the linked flaky-test process and the two failing pipeline runs to determine why the mocked call intermittently remains at zero. Done means the underlying flake is addressed and the test reliably verifies the expected dashboard behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100