Issue2713

classification
Title: Rounding a float field causes test_cpickle to fail
Type: behaviour Severity: normal
Components: Library Versions:
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen
Priority: normal Keywords: test failure causes

Created on 2018-10-27.16:08:16 by jeff.allen, last changed 2018-10-27.16:08:16 by jeff.allen.

Messages
msg12165 (view) Author: Jeff Allen (jeff.allen) Date: 2018-10-27.16:08:15
In a newly-created repo on Windows I observed this failure:

======================================================================
FAIL: test_structseq (test.test_cpickle.cPickleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Jeff\Documents\Eclipse\jython-raymond\dist\Lib\test\pickletester.py", line 652, in test_structseq
    self.assertEqual(t, u)
AssertionError: nt.stat_result(st_mode=16895, st_ino=0, st_dev=0L, st_nlink=0, st_uid=0, st_gid=0, st_size=24576, st_atime=1540644042, st_mtime=1540644042, st_ctime=1540618526) != nt.stat_result(st_mode=16895, st_ino=0, st_dev=0L, st_nlink=0, st_uid=0, st_gid=0, st_size=24576, st_atime=1540644042, st_mtime=1540644042, st_ctime=1540618527)

(The st_ctime differs by 1 in the print out.)

test_xpickle fails the same way. I think the problem is that the time at which I created the folder rounds differently in two places. The actual ctime in the PyStateResult is 1.540618526999464E9, which in the original rounds to 1540618526, but in the pickled data it is written out rounded as "aF1540618527.0". This reveals a problem pickling a "Java struct". A synthetic example is surely necessary to debug this, rather than unlucky timing.
History
Date User Action Args
2018-10-27 16:08:16jeff.allencreate