Opened 11 years ago
Closed 11 years ago
#23450 closed Bug (fixed)
Transient failure of requests.tests.RequestsTests.test_far_expiration
| Reported by: | Simon Charette | Owned by: | Paweł Marczewski |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | pwmarcz@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
Traceback (most recent call last):
File "/home/jenkins/workspace/django-master/database/mysql/python/python2.7/tests/requests/tests.py", line 178, in test_far_expiration
self.assertEqual(datetime_cookie['expires'], 'Sat, 01-Jan-2028 04:05:06 GMT')
AssertionError: u'Sat, 01-Jan-2028 04:05:07 GMT' != u'Sat, 01-Jan-2028 04:05:06 GMT'
- Sat, 01-Jan-2028 04:05:07 GMT
? ^
+ Sat, 01-Jan-2028 04:05:06 GMT
? ^
Attachments (1)
Change History (8)
comment:1 by , 11 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:4 by , 11 years ago
| Cc: | added |
|---|---|
| Has patch: | set |
comment:5 by , 11 years ago
| Patch needs improvement: | set |
|---|
I left comments for improvement on the PR. Please uncheck "Patch needs improvement" when you update it, thanks.
by , 11 years ago
| Attachment: | 23450.diff added |
|---|
comment:6 by , 11 years ago
| Patch needs improvement: | unset |
|---|
Attached a patch to admit n+1 seconds as suggested by Claude.
comment:7 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
This is probably related to this part of
django/http/response.py:delta = expires - expires.utcnow() # Add one second so the date matches exactly (a fraction of # time gets lost between converting to a timedelta and # then the date string). delta = delta + datetime.timedelta(seconds=1)The test should admit n+1 second too, IMHO.