Mercurial > hg
annotate tests/test-dirstate-read-race.t @ 50232:5bf6b8015035 stable
dirstate: check dirstate race condition around status
More problems to solve.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 26 Feb 2023 08:17:23 +0100 |
parents | 0f483a2c29e7 |
children | cf0d7cd6a6fa |
rev | line source |
---|---|
50229
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 ============================================================================== |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 Check potential race conditions between a dirstate's read and other operations |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 ============================================================================== |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
5 Some commands, like `hg status`, do not need to take the wlock but need to |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
6 access dirstate data. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 Other commands might update the dirstate data while this happens. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 This can create issues if repository data is read in the wrong order, or for |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 the dirstate-v2 format where the data is contained in multiple files. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 This test file is meant to test various cases where such parallel operations |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 happen and make sure the reading process behaves fine. We do so with a `hg |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 status` command since it is probably the most advanced of such read-only |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 command. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
16 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
17 It bears simililarity with `tests/test-dirstate-status-race.t ` but tests a |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
18 different type of race. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
19 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
20 Setup |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
21 ===== |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
22 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
23 $ directories="dir dir/nested dir2" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 $ first_files="dir/nested/a dir/b dir/c dir/d dir2/e f" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 $ second_files="g dir/nested/h dir/i dir/j dir2/k dir2/l dir/nested/m" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 $ extra_files="dir/n dir/o p q" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
28 $ hg init reference-repo |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
29 $ cd reference-repo |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
30 $ mkdir -p dir/nested dir2 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
31 $ touch -t 200001010000 $first_files $directories |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
32 $ hg commit -Aqm "recreate a bunch of files to facilitate dirstate-v2 append" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
33 $ touch -t 200001010010 $second_files $directories |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
34 $ hg commit -Aqm "more files to have two commit" |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
35 $ hg log -G -v |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
36 @ changeset: 1:9a86dcbfb938 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
37 | tag: tip |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
38 | user: test |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
39 | date: Thu Jan 01 00:00:00 1970 +0000 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
40 | files: dir/i dir/j dir/nested/h dir/nested/m dir2/k dir2/l g |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
41 | description: |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
42 | more files to have two commit |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
43 | |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
44 | |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
45 o changeset: 0:4f23db756b09 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
46 user: test |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
47 date: Thu Jan 01 00:00:00 1970 +0000 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
48 files: dir/b dir/c dir/d dir/nested/a dir2/e f |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
49 description: |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
50 recreate a bunch of files to facilitate dirstate-v2 append |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
51 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
52 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
53 $ hg manifest |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
54 dir/b |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
55 dir/c |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
56 dir/d |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
57 dir/i |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
58 dir/j |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
59 dir/nested/a |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
60 dir/nested/h |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
61 dir/nested/m |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
62 dir2/e |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
63 dir2/k |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
64 dir2/l |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
65 f |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
66 g |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
67 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
68 Add some unknown files and refresh the dirstate |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
69 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
70 $ touch -t 200001010020 $extra_files |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
71 $ hg add dir/o |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
72 $ hg remove dir/nested/m |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
73 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
74 $ hg st --config devel.dirstate.v2.data_update_mode=force-new |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
75 A dir/o |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
76 R dir/nested/m |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
77 ? dir/n |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
78 ? p |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
79 ? q |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
80 $ hg debugstate |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
81 n 644 0 2000-01-01 00:00:00 dir/b |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
82 n 644 0 2000-01-01 00:00:00 dir/c |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
83 n 644 0 2000-01-01 00:00:00 dir/d |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
84 n 644 0 2000-01-01 00:10:00 dir/i |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
85 n 644 0 2000-01-01 00:10:00 dir/j |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
86 n 644 0 2000-01-01 00:00:00 dir/nested/a |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
87 n 644 0 2000-01-01 00:10:00 dir/nested/h |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
88 r ?????????????????????????????????? dir/nested/m (glob) |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
89 a ?????????????????????????????????? dir/o (glob) |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
90 n 644 0 2000-01-01 00:00:00 dir2/e |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
91 n 644 0 2000-01-01 00:10:00 dir2/k |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
92 n 644 0 2000-01-01 00:10:00 dir2/l |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
93 n 644 0 2000-01-01 00:00:00 f |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
94 n 644 0 2000-01-01 00:10:00 g |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
95 $ hg debugstate > ../reference |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
96 $ cd .. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
97 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
98 Actual Testing |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
99 ============== |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
100 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
101 Race with a `hg add` |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
102 ------------------- |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
103 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
104 $ cp -a reference-repo race-with-add |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
105 $ cd race-with-add |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
106 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
107 spin a `hg status` with some caches to update |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
108 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
109 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
110 > --config rhg.on-unsupported=abort \ |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
111 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \ |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
112 > & |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
113 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
114 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
115 Add a file |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
116 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
117 $ hg add dir/n $d2args |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
118 $ touch $TESTTMP/status-race-lock |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
119 $ wait |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
120 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
121 The file should in a "added" state |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
122 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
123 $ hg status |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
124 A dir/n |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
125 A dir/o |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
126 R dir/nested/m |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
127 ? p |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
128 ? q |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
129 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
130 The status process should return a consistent result and not crash. |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
131 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
132 $ cat $TESTTMP/status-race-lock.out |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
133 A dir/n |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
134 A dir/o |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
135 R dir/nested/m |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
136 ? p |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
137 ? q |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
138 $ cat $TESTTMP/status-race-lock.log |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
139 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
140 final cleanup |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
141 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
142 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
143 $ cd .. |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
144 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
145 Race with a `hg commit` |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
146 ----------------------- |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
147 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
148 $ cp -a reference-repo race-with-commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
149 $ cd race-with-commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
150 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
151 spin a `hg status with some cache to update |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
152 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
153 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
154 > --config rhg.on-unsupported=abort \ |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
155 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \ |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
156 > & |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
157 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
158 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
159 Add a do a commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
160 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
161 $ hg status |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
162 A dir/o |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
163 R dir/nested/m |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
164 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
165 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
166 ? q |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
167 $ hg commit -m 'racing commit' |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
168 $ touch $TESTTMP/status-race-lock |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
169 $ wait |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
170 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
171 commit was created, and status is now clean |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
172 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
173 $ hg log -GT '{node|short} {desc}\n' |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
174 @ 02a67a77ee9b racing commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
175 | |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
176 o 9a86dcbfb938 more files to have two commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
177 | |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
178 o 4f23db756b09 recreate a bunch of files to facilitate dirstate-v2 append |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
179 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
180 $ hg status |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
181 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
182 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
183 ? q |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
184 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
185 The status process should return a consistent result and not crash. |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
186 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
187 $ cat $TESTTMP/status-race-lock.out |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
188 M dir/o (known-bad-output no-rhg !) |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
189 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
190 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
191 ? q |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
192 $ cat $TESTTMP/status-race-lock.log |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
193 warning: ignoring unknown working parent 02a67a77ee9b! (known-bad-output no-rhg !) |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
194 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
195 final cleanup |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
196 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
197 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
198 $ cd .. |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
199 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
200 Race with a `hg update` |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
201 ----------------------- |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
202 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
203 $ cp -a reference-repo race-with-update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
204 $ cd race-with-update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
205 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
206 spin a `hg status` with some caches to update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
207 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
208 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
209 > --config rhg.on-unsupported=abort \ |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
210 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \ |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
211 > & |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
212 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
213 do an update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
214 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
215 $ hg status |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
216 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
217 R dir/nested/m |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
218 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
219 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
220 ? q |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
221 $ hg log -GT '{node|short} {desc}\n' |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
222 @ 9a86dcbfb938 more files to have two commit |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
223 | |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
224 o 4f23db756b09 recreate a bunch of files to facilitate dirstate-v2 append |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
225 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
226 $ hg update --merge .^ |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
227 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
228 $ touch $TESTTMP/status-race-lock |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
229 $ wait |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
230 $ hg log -GT '{node|short} {desc}\n' |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
231 o 9a86dcbfb938 more files to have two commit |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
232 | |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
233 @ 4f23db756b09 recreate a bunch of files to facilitate dirstate-v2 append |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
234 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
235 $ hg status |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
236 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
237 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
238 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
239 ? q |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
240 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
241 The status process should return a consistent result and not crash. |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
242 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
243 $ cat $TESTTMP/status-race-lock.out |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
244 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
245 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
246 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
247 ? q |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
248 $ cat $TESTTMP/status-race-lock.log |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
249 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
250 final cleanup |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
251 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
252 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
253 $ cd .. |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
254 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
255 Race with a cache updating `hg status` |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
256 -------------------------------------- |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
257 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
258 It is interesting to race with "read-only" operation (that still update its cache) |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
259 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
260 $ cp -a reference-repo race-with-status |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
261 $ cd race-with-status |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
262 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
263 spin a `hg status` with some caches to update |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
264 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
265 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
266 > --config rhg.on-unsupported=abort \ |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
267 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \ |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
268 > & |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
269 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
270 do an update |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
271 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
272 $ touch -t 200001020006 f |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
273 $ hg status |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
274 A dir/o |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
275 R dir/nested/m |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
276 ? dir/n |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
277 ? p |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
278 ? q |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
279 $ touch $TESTTMP/status-race-lock |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
280 $ wait |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
281 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
282 The status process should return a consistent result and not crash. |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
283 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
284 $ cat $TESTTMP/status-race-lock.out |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
285 A dir/o |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
286 R dir/nested/m |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
287 ? dir/n |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
288 ? p |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
289 ? q |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
290 $ cat $TESTTMP/status-race-lock.log |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
291 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
292 final cleanup |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
293 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
294 $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
295 $ cd .. |