Ticket #3812 defect closed fixed

Opened 5 years ago

Last modified 5 years ago

twisted.mail.test.test_mail.MaildirTestCase.testMailbox fails intermittently

Reported by: glyph Owned by:
Priority: normal Milestone:
Component: mail Keywords:
Cc: Branch: branches/mailbox-order-3812
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:


trial -u produces a traceback in fairly short order:

[FAIL]: twisted.mail.test.test_mail.MaildirTestCase.testMailbox

Traceback (most recent call last):
  File "/home/glyph/Projects/Twisted/trunk/twisted/mail/test/test_mail.py", line 452, in testMailbox
    self.assertEquals(mb.listMessages(), range(1, 11))
twisted.trial.unittest.FailTest: not equal:
a = [4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Change History


Changed 5 years ago by glyph

  • type changed from enhancement to defect


Changed 5 years ago by exarkun

  • branch set to branches/mailbox-order-3812
  • branch_author set to exarkun

(In [26817]) Branching to 'mailbox-order-3812'


Changed 5 years ago by exarkun

(In [26818]) Pad the microsecond field of the generated filenames so that the names sort properly

refs #3812


Changed 5 years ago by exarkun

(In [26819]) fixup testMailbox

refs #3812


Changed 5 years ago by exarkun

  • keywords review added
  • owner exarkun deleted

This happened when microseconds value jumped up another digit (eg 7 to 10 or 96 to 100), causing files delivered later to have names which sorted earlier. I've fixed this by padding the microsecond value to fix sorting. A potential problem still remains - the seconds value will jump from 10 digits to 11 digits in 277 years; files created after that jump will sort before files created today, causing mailboxes to appear out of order. I'm not going to fix that now, though.

 Build results


Changed 5 years ago by glyph

  • owner set to exarkun
  • keywords easy review removed

Hooray for private implementation details which can be incompatibly changed!

Land it.


Changed 5 years ago by exarkun

(In [26820]) Update copyright dates

refs #3812


Changed 5 years ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [26821]) Merge mailbox-order-3812

Author: exarkun Reviewer: glyph Fixes: #3812

Fix an intermittent failure in the message ordering of the maildir-based mailbox implementation. Previously messages delivered within the same second had a small chance to be delivered in such a way which that they would appear to have been delivered in the opposite order as they really were.


Changed 3 years ago by <automation>

  • owner exarkun deleted
Note: See TracTickets for help on using tickets.