Opened 9 years ago

Closed 9 years ago

#3812 defect closed fixed (fixed)

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
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun


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/", 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 (9)

comment:1 Changed 9 years ago by Glyph

Type: enhancementdefect

comment:2 Changed 9 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/mailbox-order-3812

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

comment:3 Changed 9 years ago by Jean-Paul Calderone

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

refs #3812

comment:4 Changed 9 years ago by Jean-Paul Calderone

(In [26819]) fixup testMailbox

refs #3812

comment:5 Changed 9 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone 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

comment:6 Changed 9 years ago by Glyph

Keywords: easy review removed
Owner: set to Jean-Paul Calderone

Hooray for private implementation details which can be incompatibly changed!

Land it.

comment:7 Changed 9 years ago by Jean-Paul Calderone

(In [26820]) Update copyright dates

refs #3812

comment:8 Changed 9 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(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.

comment:9 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.