annotate tests/test-lock-badness.t @ 52311:f7b2806035a7

rust: update `clap` to the latest 4.x version This brings in more up-to-date dependencies, some bug fixes (none of which are relevant yet), and slightly improved compile times.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 04 Nov 2024 15:23:41 +0100
parents 9da3fcc5f70f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22047
8fb6844a4ff1 tests: change some #ifs to #requires
Matt Mackall <mpm@selenic.com>
parents: 20969
diff changeset
1 #require unix-permissions no-root no-windows
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
2
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
3 Prepare
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
4
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
5 $ hg init a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
6 $ echo a > a/a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
7 $ hg -R a ci -A -m a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
8 adding a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
9
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
10 $ hg clone a b
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
11 updating to branch default
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2016
ff5c9a92f556 fix backtrace printed when cannot get lock.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
13
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
14 Test that raising an exception in the release function doesn't cause the lock to choke
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
15
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
16 $ cat > testlock.py << EOF
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 29883
diff changeset
17 > from mercurial import error, registrar
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
18 >
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
19 > cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 29883
diff changeset
20 > command = registrar.command(cmdtable)
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
21 >
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
22 > def acquiretestlock(repo, releaseexc):
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
23 > def unlock():
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
24 > if releaseexc:
36643
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
25 > raise error.Abort(b'expected release exception')
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
26 > l = repo._lock(repo.vfs, b'testlock', False, unlock, None, b'test lock')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
27 > return l
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
28 >
33097
fce4ed2912bb py3: make sure commands name are bytes in tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 32337
diff changeset
29 > @command(b'testlockexc')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
30 > def testlockexc(ui, repo):
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
31 > testlock = acquiretestlock(repo, True)
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
32 > try:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
33 > testlock.release()
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
34 > finally:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
35 > try:
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
36 > testlock = acquiretestlock(repo, False)
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
37 > except error.LockHeld:
36643
1e1c1bfb0be4 py3: add some b'' to make test-lock-badness.t happy
Yuya Nishihara <yuya@tcha.org>
parents: 35209
diff changeset
38 > raise error.Abort(b'lockfile on disk even after releasing!')
23032
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
39 > testlock.release()
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
40 > EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
41 $ cat >> $HGRCPATH << EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
42 > [extensions]
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
43 > testlock=$TESTTMP/testlock.py
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
44 > EOF
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
45
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
46 $ hg -R b testlockexc
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
47 abort: expected release exception
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
48 [255]
f484be02bd35 lock: while releasing, unlink lockfile even if the release function throws
Siddharth Agarwal <sid0@fb.com>
parents: 22047
diff changeset
49
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
50 One process waiting for another
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
51
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
52 $ SYNC_FILE_LOCKED="$TESTTMP/sync-file-locked"
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
53 $ export SYNC_FILE_LOCKED
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
54 $ SYNC_FILE_TRYING_LOCK="$TESTTMP/sync-file-trying-lock"
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
55 $ export SYNC_FILE_TRYING_LOCK
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
56 $ cat << EOF > locker.sh
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
57 > $RUNTESTDIR/testlib/wait-on-file 10 $SYNC_FILE_TRYING_LOCK $SYNC_FILE_LOCKED;
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
58 > EOF
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
59 $ cat << EOF > waiter.sh
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
60 > $RUNTESTDIR/testlib/wait-on-file 10 $SYNC_FILE_LOCKED;
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
61 > EOF
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
62 $ clean_sync() {
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
63 > rm -f "$SYNC_FILE_LOCKED"
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
64 > rm -f "$SYNC_FILE_TRYING_LOCK"
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
65 > }
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
66
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
67
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
68 $ clean_sync
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
69 $ echo b > b/b
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
70 $ hg -R b ci -A -m b \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
71 > --config hooks.precommit="sh $TESTTMP/locker.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
72 > > stdout &
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
73 $ hg -R b up -q \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
74 > --config ui.timeout.warn=0 \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
75 > --config hooks.pre-update="sh $TESTTMP/waiter.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
76 > --config devel.lock-wait-sync-file="$SYNC_FILE_TRYING_LOCK" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
77 > > preup-stdout 2> preup-stderr
29008
38292b227deb tests: test-lock-badness.t message could come later
timeless <timeless@mozdev.org>
parents: 26587
diff changeset
78 $ wait
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
79 $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
80 $ cat preup-stderr
29883
0c8c388c7d62 lock: show more detail for new-style locks in lock waiting message (issue4752)
Mark Ignacio <mignacio@fb.com>
parents: 29008
diff changeset
81 waiting for lock on working directory of b held by process '*' on host '*' (glob)
29008
38292b227deb tests: test-lock-badness.t message could come later
timeless <timeless@mozdev.org>
parents: 26587
diff changeset
82 got lock after * seconds (glob)
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
83 $ cat stdout
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
84 adding b
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
85
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
86 On processs waiting on another, warning after a long time.
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
87
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
88 $ clean_sync
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
89 $ echo b > b/c
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
90 $ hg -R b ci -A -m b \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
91 > --config hooks.precommit="sh $TESTTMP/locker.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
92 > > stdout &
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
93 $ hg -R b up -q \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
94 > --config hooks.pre-update="sh $TESTTMP/waiter.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
95 > --config devel.lock-wait-sync-file="$SYNC_FILE_TRYING_LOCK" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
96 > --config ui.timeout.warn=250 \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
97 > > preup-stdout 2> preup-stderr
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
98 $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
99 $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
100 $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
101 $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
102 adding c
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
103
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
104 On processs waiting on another, warning disabled.
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
105
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
106 $ clean_sync
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
107 $ echo b > b/d
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
108 $ hg -R b ci -A -m b \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
109 > --config hooks.precommit="sh $TESTTMP/locker.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
110 > > stdout &
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
111 $ hg -R b up -q \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
112 > --config hooks.pre-update="sh $TESTTMP/waiter.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
113 > --config devel.lock-wait-sync-file="$SYNC_FILE_TRYING_LOCK" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
114 > --config ui.timeout.warn=-1 \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
115 > > preup-stdout 2>preup-stderr
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
116 $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
117 $ cat preup-stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
118 $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
119 $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
120 adding d
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
121
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
122 check we still print debug output
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
123
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
124 On processs waiting on another, warning after a long time (debug output on)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
125
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
126 $ clean_sync
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
127 $ echo b > b/e
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
128 $ hg -R b ci -A -m b \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
129 > --config hooks.precommit="sh $TESTTMP/locker.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
130 > > stdout &
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
131 $ hg -R b up \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
132 > --config hooks.pre-update="sh $TESTTMP/waiter.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
133 > --config devel.lock-wait-sync-file="$SYNC_FILE_TRYING_LOCK" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
134 > --config ui.timeout.warn=250 --debug \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
135 > > preup-stdout 2>preup-stderr
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
136 $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
137 $ cat preup-stdout
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
138 running hook pre-update: sh $TESTTMP/waiter.sh
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
139 waiting for lock on working directory of b held by process '*' on host '*' (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
140 got lock after * seconds (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
142 $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
143 $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
144 adding e
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
145
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
146 On processs waiting on another, warning disabled, (debug output on)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
147
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
148 $ clean_sync
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
149 $ echo b > b/f
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
150 $ hg -R b ci -A -m b \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
151 > --config hooks.precommit="sh $TESTTMP/locker.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
152 > > stdout &
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
153 $ hg -R b up \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
154 > --config hooks.pre-update="sh $TESTTMP/waiter.sh" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
155 > --config devel.lock-wait-sync-file="$SYNC_FILE_TRYING_LOCK" \
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
156 > --config ui.timeout.warn=-1 --debug\
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
157 > > preup-stdout 2>preup-stderr
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
158 $ wait
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
159 $ cat preup-stdout
51497
9da3fcc5f70f test-lock: use synchronisation file instead of sleep
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50292
diff changeset
160 running hook pre-update: sh $TESTTMP/waiter.sh
35209
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
161 waiting for lock on working directory of b held by process '*' on host '*' (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
162 got lock after * seconds (glob)
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
163 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
164 $ cat preup-stderr
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
165 $ cat stdout
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
166 adding f
9153871d50e0 lock: allow to configure when the lock messages are displayed
Boris Feld <boris.feld@octobus.net>
parents: 33097
diff changeset
167
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
168 Pushing to a local read-only repo that can't be locked
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
169
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
170 $ chmod 100 a/.hg/store
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
171
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
172 $ hg -R b push a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
173 pushing to a
20969
7a679918ee2b localrepo: add unbundle support
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20653
diff changeset
174 searching for changes
50292
adecb1ab4a0d tests: add a rewriting step to detect EACCES errors
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46015
diff changeset
175 abort: could not lock repository a: $EACCES$
45828
e0dbfbd4062c errors: set detailed exit code to 20 for locking errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 36643
diff changeset
176 [20]
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
177
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
178 $ chmod 700 a/.hg/store