Tim Peters added the comment:

Martin, I don't see how:

> What *can* happen is that ts1 > T(ts2)

_in this test_.  As shown in many failure examples *both* nanosecond timestamps 
had non-zero nanoseconds.  Like:

AssertionError: 1385161652120374900 not greater than or equal to
1385161652120375500

Anything coming from T() would have "000" at the end, not "900" or "500".  T() 
only retains microseconds.  Or do you disagree with that?

In any case, we're comparing apples to oranges here somehow ;-) If I add:

        p.touch()

right before:

        st = p.stat()
        old_mtime = st.st_mtime
        old_mtime_ns = st.st_mtime_ns

then we're certainly comparing a modification (as opposed to creation) time to 
a modification time, and I get no more errors.  The nanosecond-difference 
distribution across 300 runs changed to the obviously bi-modal:

       0: 193
  975800:  12
  975900:   7
  976000:   5
  976100:  29
  976800:  10
  977000:  35
  977100:   9
          ---
          300

I suggest too that's a better way to fix the test than the current

            delta = 1e-6 if os.name == 'nt' else 0

dance.  There's no justification for 1e-6 beyond "well, it seemed to work", and 
I have shown failure cases with a delta as large as 0.6e-6.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19715>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to