On 22.01.2017 13:54, Andreas Cadhalpun wrote: > I think the answer is that you were lucky. ;) > The problem can be reproduced by running: > $ python -m pytest -v -x -rs testing/test_gateway.py > > I did that 100 times and it failed 78 times, working only 22 times. > > The failing test contains: > for i in range(10): > status = gw.remote_status() > if status.numexecuting == 0: > break > else: > pytest.fail("did not get correct remote status") > > Apparently there is a race condition, so it is tried 10 times. > However, it is tried in a tight loop, thus not much time passes > between the first and the last try. Making it sleep inside the > loop helps. > > There is a similar construct in test_status_with_threads, > which fails in a similar way, but after changing both to wait > a bit (with attached patch), the test succeeded 100 times > for 100 tries.
Hi Andreas, ... that looks very good, ♪thank you♪ very much! Daniel -- 4096R/DF5182C8 Debian Developer (sten...@debian.org) LPIC-1 (LPI000329859 64mz6f7kt4) http://www.danielstender.com/