annotate tests/test-lock-badness.t @ 21754:7e14d026c4c4

run-tests: fixes the '--interactive' option error This patch fixes a regression recently introduced by a refactoring. Previously when failure occurs while testing with '--interactive' was enable, it didn't prompt user by asking whether he wants to accept this failure changes or not. This was happening beacuse of the 'if' condition if ret or not self._options.interactive or \ not os.path.exists(test.errpath): Everytime failure occurs, this condition gets true and returns back even when '--interactive' is enabled. This condition don't led the function to execute further, which consist the '--interactive' functionality. Now, on failure with '--interactive' enabled, it prompts user whether he wants to accepts failure changes or not. If yes then test gets passed and returns true, else test gets failed. On every failure, results gets stored in "self.failures.append((test, reason))" But if failure changes accepted by user then test must get "pop out" from failed test list.
author anuraggoel <anurag.dsps@gmail.com>
date Fri, 13 Jun 2014 14:45:23 +0530
parents 7a679918ee2b
children 8fb6844a4ff1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
1 #if unix-permissions no-root no-windows
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
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
14 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
15
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
16 $ cat > hooks.py << EOF
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
17 > import time
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
18 > def sleepone(**x): time.sleep(1)
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
19 > def sleephalf(**x): time.sleep(0.5)
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
20 > EOF
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
21 $ echo b > b/b
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
22 $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout &
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
23 $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf"
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
24 waiting for lock on working directory of b held by '*:*' (glob)
20653
3bfac190c7cd tests: match time by a glob to fix intermittent failures of test-lock-badness.t
Simon Heimberg <simohe@besonet.ch>
parents: 20380
diff changeset
25 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
26 warning: ignoring unknown working parent d2ae7f538514!
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
27 $ wait
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
28 $ cat stdout
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
29 adding b
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
30
20380
c697b70f295f localrepo: give a sigh of relief when getting lock after waiting for it
Mads Kiilerich <madski@unity3d.com>
parents: 20008
diff changeset
31 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
32
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
33 $ chmod 100 a/.hg/store
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
34
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
35 $ hg -R b push a
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
36 pushing to a
20969
7a679918ee2b localrepo: add unbundle support
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 20653
diff changeset
37 searching for changes
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
38 abort: could not lock repository a: Permission denied
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12071
diff changeset
39 [255]
12071
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
40
45ff6dcf82ea tests: unify test-lock-badness
Adrian Buehlmann <adrian@cadifra.com>
parents: 3853
diff changeset
41 $ chmod 700 a/.hg/store
20008
e54a078153f7 tests: skip tests that require not having root (issue4089)
Matt Mackall <mpm@selenic.com>
parents: 15443
diff changeset
42 #endif