openedx / openedx/openedx-platform
[Flaky test] `openedx/core/djangoapps/user_authn/views/tests/test_login.py::LoginTest::test_login_ratelimited`
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/25096
See docs on how to address flaky tests for why this should be fixed and how to go about it.
- It failed and passed on the same commit on this PR: https://github.com/edx/edx-platform/pull/25082
- Failed build in Jenkins: https://build.testeng.edx.org/job/edx-platform-python-pipeline-pr/21935/
Failure output:
self = <openedx.core.djangoapps.user_authn.views.tests.test_login.LoginTest testMethod=test_login_ratelimited>
def test_login_ratelimited(self):
"""
Test that login endpoint is IP ratelimited and only allow 5 requests
per 5 minutes per IP.
"""
for i in range(5):
password = u'test_password{0}'.format(i)
response, _audit_log = self._login_response(self.user_email, password)
self._assert_response(response, success=False)
response, _audit_log = self._login_response(self.user_email, self.password)
> self.assertEqual(response.status_code, 403)
E AssertionError: 200 != 403
openedx/core/djangoapps/user_authn/views/tests/test_login.py:396: AssertionError
Migrate from private ticket https://2u-internal.atlassian.net/issues/CR-2761
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/core/djangoapps/user_authn/views/tests/test_login.py and the deleted LoginTest::test_login_ratelimited test. Review the linked flaky-test process and the failure from PR 25082, then trace the rate-limit setup used by the test. Done means the login rate-limit behavior is covered reliably and the test no longer intermittently returns 200 instead of 403.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100