Opened 5 years ago

Closed 5 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
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

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 (9)

comment:1 Changed 5 years ago by glyph

  • Type changed from enhancement to defect

comment:2 Changed 5 years ago by exarkun

  • Author set to exarkun
  • Branch set to branches/mailbox-order-3812

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

comment:3 Changed 5 years ago by exarkun

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

refs #3812

comment:4 Changed 5 years ago by exarkun

(In [26819]) fixup testMailbox

refs #3812

comment:5 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

comment:6 Changed 5 years ago by glyph

  • Keywords easy review removed
  • Owner set to exarkun

Hooray for private implementation details which can be incompatibly changed!

Land it.

comment:7 Changed 5 years ago by exarkun

(In [26820]) Update copyright dates

refs #3812

comment:8 Changed 5 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(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 3 years ago by <automation>

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