[Python-apps-team] Bug#844081: Reproducer

Filip Pytloun filip at pytloun.cz
Tue Nov 29 15:47:16 UTC 2016


Hello Christian,

I tried to execute the script during build process.

Here is a couple of outputs from machine where this build is sometimes
failing:

[(0, 9), (0.0001, 9), (0.001, 8), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 8), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 9), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 9), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 9), (0.0001, 10), (0.001, 6), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 6), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 9), (0.0001, 9), (0.001, 6), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 9), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 6), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 10), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 7), (0.01, 0), (0.1, 0), (1, 0)]
[(0, 10), (0.0001, 9), (0.001, 6), (0.01, 0), (0.1, 0), (1, 0)]

Filip

On 2016/11/27 00:38, Christian Geier wrote:
> Hi Filip,
> could you perhaps run the attached file on the test machine (with
> `py.test vdir_test.py`, py.test is needed for the creation of a temp
> directory).
> 
> On my machine the output looks like this:
> [(0, 10), (0.0001, 8), (0.001, 0), (0.01, 0), (0.1, 0), (1, 0)]
> 
> Similar experiments before made me choose the current delay.
> 
> Best regards,
> Christian
> 
> Quoting Filip Pytloun (2016-11-24 00:20:50)
> > On 2016/11/24 00:00, Santiago Vila wrote:
> > > Try using a chroot without union-type=overlay.
> > 
> > Unfortunately it will result in the same error :-/

> import os
> import time
> 
> 
> def get_etag_from_file(f):
>     '''Get mtime-based etag from a filepath or file-like object.
> 
>     This function will flush/sync the file as much as necessary to obtain a
>     correct mtime.
>     '''
>     stat = os.stat(f)
>     mtime = getattr(stat, 'st_mtime_ns', None)
>     if mtime is None:
>         mtime = stat.st_mtime
>     return '{:.9f}'.format(mtime)
> 
> 
> def test_etag(tmpdir):
>     fpath = os.path.join(str(tmpdir), 'foo')
>     stats = dict()
>     for delay in [0, 0.0001, 0.001, 0.01, 0.1, 1]:
>         failed = list()
>         for one in range(10):
> 
>             file_ = open(fpath, 'w')
>             file_.write('foo')
>             file_.close()
> 
>             old_etag = get_etag_from_file(fpath)
>             time.sleep(delay)
> 
>             file_ = open(fpath, 'w')
>             file_.write('bar')
>             file_.close()
> 
>             new_etag = get_etag_from_file(fpath)
> 
>             if old_etag == new_etag:
>                 failed.append(
>                     (one, new_etag)
>                 )
>             stats[delay] = len(failed)
>     print(sorted(stats.items()))
>     assert False  # here to make sure we get the print output via py.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20161129/00a5a5eb/attachment.sig>


More information about the Python-apps-team mailing list