Issue2586

classification
Title: test_mailbox fails on Linux
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: stefan.richthofer
Priority: normal Keywords:

Created on 2017-05-05.11:52:52 by stefan.richthofer, last changed 2017-05-05.12:11:57 by stefan.richthofer.

Messages
msg11353 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-05-05.11:52:52
On Linux Mint 64Bit, Java 8 I observe test_mailbox to fail. Note that it doesn't fail on Windows (or is skipped there, I currently cannot tell).
Also note that in discussion of #2585 I learned that this failure isn't commonly visible.

======================================================================
FAIL: test_file_permissions (__main__.TestMaildir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 787, in test_file_permissions
    self.assertEqual(mode & 0111, 0)
AssertionError: 73 != 0

======================================================================
FAIL: test_folder_file_perms (__main__.TestMaildir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 804, in test_folder_file_perms
    self.assertFalse((perms & 0111)) # Execute bits should all be off.
AssertionError: 73 is not false

======================================================================
FAIL: test_file_perms (__main__.TestMbox)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 1011, in test_file_perms
    self.assertFalse((perms & 0111)) # Execute bits should all be off.
AssertionError: 73 is not false

======================================================================
FAIL: test_mboxmmdf_to_maildir (__main__.TestMessageConversion)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 1580, in test_mboxmmdf_to_maildir
    self.assertEqual(msg.get_date(), 0.0)
AssertionError: 1493984035.955 != 0.0

----------------------------------------------------------------------
Ran 303 tests in 8.456s

FAILED (failures=4, skipped=2)
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 2122, in <module>
    test_main()
  File "Lib/test/test_mailbox.py", line 2117, in test_main
    test_support.run_unittest(*tests)
  File "/data/workspace/linux/Jython/ssh/jython/dist/Lib/test/test_support.py", line 1330, in run_unittest
    _run_suite(suite)
  File "/data/workspace/linux/Jython/ssh/jython/dist/Lib/test/test_support.py", line 1313, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: multiple errors occurred


Seeing the file permission related failures it occurred to me that my workspace folder is on an NTFS partition so I can easily access it from Windows. NTFS has less fine grained file permission handling, so I tried the test on an ext4 partition. There it still fails, but yields fewer failures:

======================================================================
FAIL: test_mboxmmdf_to_maildir (__main__.TestMessageConversion)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 1580, in test_mboxmmdf_to_maildir
    self.assertEqual(msg.get_date(), 0.0)
AssertionError: 1493984654.341 != 0.0

----------------------------------------------------------------------
Ran 303 tests in 5.819s

FAILED (failures=1, skipped=2)
Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 2122, in <module>
    test_main()
  File "Lib/test/test_mailbox.py", line 2117, in test_main
    test_support.run_unittest(*tests)
  File "/home/stefan/Jython/jython/dist/Lib/test/test_support.py", line 1330, in run_unittest
    _run_suite(suite)
  File "/home/stefan/Jython/jython/dist/Lib/test/test_support.py", line 1313, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 1580, in test_mboxmmdf_to_maildir
    self.assertEqual(msg.get_date(), 0.0)
AssertionError: 1493984654.341 != 0.0


Still - the test shouldn't fail because of running on an NTFS partition. If NTFS inherently yields insufficient permission handling for some tests, these should detect it somehow and be skipped or so.
msg11355 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-05-05.12:11:57
I opened #2587 as a separate issue for the NTFS situation, because that phenomenon affects test_dumbdbm and test_shutil too.
This mostly explains why these failures are not commonly visible.

The remaining failure here seems to be date related:

Traceback (most recent call last):
  File "Lib/test/test_mailbox.py", line 1580, in test_mboxmmdf_to_maildir
    self.assertEqual(msg.get_date(), 0.0)
AssertionError: 1493984654.341 != 0.0
History
Date User Action Args
2017-05-05 12:11:57stefan.richthofersetmessages: + msg11355
2017-05-05 11:52:52stefan.richthofercreate