[PATCH] run-tests: "fix" race condition in race condition fix

timeless timeless at gmail.com
Fri Jan 22 19:30:48 UTC 2016


On Fri, Jan 22, 2016 at 2:00 PM, Bryan O'Sullivan <bos at serpentine.com> wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1453489213 28800
> #      Fri Jan 22 11:00:13 2016 -0800
> # Branch stable
> # Node ID 6bb64e83ac188ee99528ad0237028f00047ab505
> # Parent  0b752757a0c4f30ac755389014e2af9d2e0b4a3f
> run-tests: "fix" race condition in race condition fix
>
> Laurent's commit 3203dfe341f9 still suffers from a race: by the
> time the "job" function tries to assign to channels[channel], that
> list has been truncated to empty.  The result is that every job
> thread raises an IndexError.
>
> Earlier, I tried an approach of correctly locking channels, but
> that caused run-tests to hang on KeyboardInterrupt sometimes.
>
> This approach is strictly hackier, but seems to actually work
> reliably.

I really wish this worked :(

(py)[timeless at gcc2-power8 crew]$ hg import ../crew0/0
applying ../crew0/0
(py)[timeless at gcc2-power8 crew]$ cd tests/
(py)[timeless at gcc2-power8 tests]$ ./run-tests.py -l -j120
..ss^C
Skipped test-convert-svn-source.t: missing feature: subversion python bindings
Skipped test-convert-svn-move.t: missing feature: subversion python bindings
# Ran 122 tests, 2 skipped, 0 warned, 0 failed.
INTERRUPTED: test-convert-cvs.t (after 2 seconds)
INTERRUPTED: test-contrib-check-code.t (after 2 seconds)
INTERRUPTED: test-pull-pull-corruption.t (after 2 seconds)
INTERRUPTED: test-mv-cp-st-diff.t (after 2 seconds)
INTERRUPTED: test-check-code.t (after 2 seconds)
INTERRUPTED: test-check-py3-compat.t (after 2 seconds)
INTERRUPTED: test-convert-svn-encoding.t (after 2 seconds)
INTERRUPTED: test-check-commit.t (after 2 seconds)
EINTERRUPTED: test-histedit-fold.t (after 1 seconds)
EINTERRUPTED: test-lfconvert.t (after 1 seconds)
EINTERRUPTED: test-hgweb-symrev.t (after 2 seconds)
INTERRUPTED: test-hgweb-empty.t (after 1 seconds)
INTERRUPTED: test-bundle2-exchange.t (after 2 seconds)
INTERRUPTED: test-encoding-textwrap.t (after 2 seconds)
INTERRUPTED: test-rebase-check-restore.t (after 2 seconds)
INTERRUPTED: test-gendoc.t (after 3 seconds)
INTERRUPTED: test-obsolete-checkheads.t (after 3 seconds)
INTERRUPTED: test-notify.t (after 2 seconds)
INTERRUPTED: test-check-execute.t (after 3 seconds)
INTERRUPTED: test-contrib-perf.t (after 4 seconds)
INTERRUPTED: test-bundle2-format.t (after 4 seconds)
INTERRUPTED: test-acl.t (after 5 seconds)
INTERRUPTED: test-hgweb-commands.t (after 5 seconds)
INTERRUPTED: test-patchbomb.t (after 7 seconds)
INTERRUPTED: test-merge-changedelete.t (after 7 seconds)
INTERRUPTED: test-merge-force.t (after 10 seconds)
INTERRUPTED: test-rename-merge2.t (after 10 seconds)


^C^C^C^C^C^C^C^Z
[4]+  Stopped                 ./run-tests.py -l -j120
(py)[timeless at gcc2-power8 tests]$ hg log -r .
changeset:   30698:6bb64e83ac18
branch:      stable
tag:         tip
parent:      30636:0b752757a0c4
user:        Bryan O'Sullivan <bryano at fb.com>
date:        Fri Jan 22 11:00:13 2016 -0800
summary:     run-tests: "fix" race condition in race condition fix

(py)[timeless at gcc2-power8 tests]$ hg log -r . -v
changeset:   30698:6bb64e83ac18
branch:      stable
tag:         tip
parent:      30636:0b752757a0c4
user:        Bryan O'Sullivan <bryano at fb.com>
date:        Fri Jan 22 11:00:13 2016 -0800
files:       tests/run-tests.py
description:
run-tests: "fix" race condition in race condition fix

Laurent's commit 3203dfe341f9 still suffers from a race: by the
time the "job" function tries to assign to channels[channel], that
list has been truncated to empty.  The result is that every job
thread raises an IndexError.

Earlier, I tried an approach of correctly locking channels, but
that caused run-tests to hang on KeyboardInterrupt sometimes.

This approach is strictly hackier, but seems to actually work
reliably.


(py)[timeless at gcc2-power8 tests]$



More information about the Mercurial-devel mailing list