[Django] #26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration

3 views
Skip to first unread message

Django

unread,
Jan 22, 2016, 3:07:43 PM1/22/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
{{{
Traceback (most recent call last):
File "/home/jenkins/workspace/pull-requests-
trusty/database/postgis/label/trusty-
pr/python/python2.7/tests/requests/tests.py", line 240, in
test_max_age_expiration
self.assertEqual(max_age_cookie['expires'], cookie_date(time.time() +
10))
AssertionError: u'Fri, 22-Jan-2016 19:44:54 GMT' != u'Fri, 22-Jan-2016
19:44:55 GMT'
- Fri, 22-Jan-2016 19:44:54 GMT
? ^
+ Fri, 22-Jan-2016 19:44:55 GMT
? ^
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26126>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 12, 2016, 2:05:25 AM2/12/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* cc: berker.peksag@… (added)
* owner: nobody => berkerpeksag
* has_patch: 0 => 1
* status: new => assigned


Comment:

Pull request: https://github.com/django/django/pull/6130

Alternative solutions:

* Make assertEqual check less strict: Don't check for the exact return
value of `cookie_date()`.
* Convert assertEqual to assertIn and check if the return value is
`time.time() + 10 + 1` or `time.time() + 10 - 1`. This is simpler than the
first solution.
* Mock `cookie_date()` in `HttpResponseBase.set_cookie()`.

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:1>

Django

unread,
Feb 13, 2016, 7:25:39 AM2/13/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


Comment:

As noted on the PR, can `django.test.utils.freeze_time()` help?

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:2>

Django

unread,
Feb 14, 2016, 10:59:42 AM2/14/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by berkerpeksag):

* needs_better_patch: 1 => 0


Comment:

Yes, `freeze_time()` is a better solution. I've updated the PR to use
`freeze_time()`. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:3>

Django

unread,
Feb 15, 2016, 8:50:26 AM2/15/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:4>

Django

unread,
Feb 15, 2016, 9:26:57 AM2/15/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b17a9150a0c3a132e82b53755ede62a45f897875" b17a9150]:
{{{
#!CommitTicketReference repository=""
revision="b17a9150a0c3a132e82b53755ede62a45f897875"
Fixed #26126 -- Fixed transient failure of test_max_age_expiration
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:5>

Django

unread,
Feb 15, 2016, 9:27:22 AM2/15/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"33b5bb79308c26615f55dc5eef85deb25f741ce2" 33b5bb79]:
{{{
#!CommitTicketReference repository=""
revision="33b5bb79308c26615f55dc5eef85deb25f741ce2"
[1.9.x] Fixed #26126 -- Fixed transient failure of test_max_age_expiration

Backport of b17a9150a0c3a132e82b53755ede62a45f897875 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:6>

Django

unread,
Feb 15, 2016, 9:27:26 AM2/15/16
to django-...@googlegroups.com
#26126: Transient failure of requests.tests.RequestsTests.test_max_age_expiration
-------------------------------------+-------------------------------------
Reporter: charettes | Owner:
Type: | berkerpeksag
Cleanup/optimization | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"927f43ea3add3cf92856c447bb021b59b22603df" 927f43ea]:
{{{
#!CommitTicketReference repository=""
revision="927f43ea3add3cf92856c447bb021b59b22603df"
[1.8.x] Fixed #26126 -- Fixed transient failure of test_max_age_expiration

Backport of b17a9150a0c3a132e82b53755ede62a45f897875 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26126#comment:7>

Reply all
Reply to author
Forward
0 new messages