Opened 9 years ago

Closed 9 years ago

#25558 closed Bug (fixed)

Non-deterministic test failure on Windows: test_clearsessions_command

Reported by: Tim Graham Owned by: Brian Gianforcaro
Component: contrib.sessions Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since c055224763e11b29cce0a7c10751354c40dac63e, the following test failure occurs sometimes on Windows.

FAIL: test_clearsessions_command (sessions_tests.tests.FileSessionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\projects\django\django\test\utils.py", line 181, in inner
    return test_func(*args, **kwargs)
  File "C:\projects\django\tests\sessions_tests\tests.py", line 563, in test_clearsessions_command
    self.assertEqual(1, count_sessions())
AssertionError: 1 != 2

Change History (3)

comment:1 by Brian Gianforcaro, 9 years ago

Owner: changed from nobody to Brian Gianforcaro
Status: newassigned

comment:2 by Brian Gianforcaro, 9 years ago

Sent pull request here: https://github.com/django/django/pull/5434

Looks to be a timing related issue with the file backend, where we weren't handling the case where the expiry age is zero, which arguably is also expired.

comment:3 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In a3fffdc:

Fixed #25558 -- Fixed nondeterministic test failure on Windows: test_clearsessions_command.

The test session without an expiration date added in refs #22938 wasn't
always deleted on Windows because get_expiry_age() returns zero and the
file backend didn't consider that an expired session.

Note: See TracTickets for help on using tickets.
Back to Top