Mercurial > hg
view tests/test-missing-capability.t @ 42943:5fadf6103790
remotefilelog: replace repack lock to solve race condition
2c74337e6483 reduced the probability of race-conditions when starting
background repack and prefetch and we saw the difference in our CI instance
with all failures disappearing except one where one call to waitonrepack seems
to returns too early.
I'm not sure what exactly goes wrong but I realized that while the prefetch
operation uses a standard Mercurial lock, the repack operation is using a
custom lock based on `fcntl.flock` on available platforms. As `extutil.flock`
fallback on traditional Mercurial locks on other platforms and the tests are
stable on my laptop, our CI environment and GCC112, I'm sending this patch to
standardize the behavior across environments.
Differential Revision: https://phab.mercurial-scm.org/D6844
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 11 Sep 2019 17:41:13 +0200 |
parents | d3cc9a8df63a |
children | 8d72e29ad1e0 |
line wrap: on
line source
Checking how hg behaves when one side of a pull/push doesn't support some capability (because it's running an older hg version, usually). $ hg init repo1 $ cd repo1 $ echo a > a; hg add -q a; hg commit -q -m a $ hg bookmark a $ hg clone -q . ../repo2 $ cd ../repo2 $ touch $TESTTMP/disable-lookup.py $ disable_cap() { > rm -f $TESTTMP/disable-lookup.pyc # pyc caching is buggy > cat <<EOF > $TESTTMP/disable-lookup.py > from mercurial import extensions, wireprotov1server > def wcapabilities(orig, *args, **kwargs): > cap = orig(*args, **kwargs) > cap.remove(b'$1') > return cap > extensions.wrapfunction(wireprotov1server, '_capabilities', wcapabilities) > EOF > } $ cat >> ../repo1/.hg/hgrc <<EOF > [extensions] > disable-lookup = $TESTTMP/disable-lookup.py > EOF $ cat >> .hg/hgrc <<EOF > [ui] > ssh = "$PYTHON" "$TESTDIR/dummyssh" > EOF $ hg pull ssh://user@dummy/repo1 -r tip -B a pulling from ssh://user@dummy/repo1 no changes found $ disable_cap lookup $ hg pull ssh://user@dummy/repo1 -r tip -B a pulling from ssh://user@dummy/repo1 abort: other repository doesn't support revision lookup, so a rev cannot be specified. [255] $ disable_cap pushkey $ hg pull ssh://user@dummy/repo1 -r tip -B a pulling from ssh://user@dummy/repo1 abort: remote bookmark a not found! [255]