Mercurial > hg
annotate tests/test-dirstate-read-race.t @ 50238:c9066fc609ef stable
dirstate: deal with read-race for python code using rust object
If we cannot read the dirstate data, this is probably because a writing process
wrote it under our feet. So refresh the docket and try again a handful of time.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 28 Feb 2023 23:35:52 +0100 |
parents | a3b1ab5f5dee |
children | 491f3dd080eb |
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 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
5 #testcases dirstate-v1 dirstate-v2-append dirstate-v2-rewrite |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
6 #testcases pre-all-read pre-some-read |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
7 |
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
|
8 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
|
9 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
|
10 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
|
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 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
|
13 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
|
14 |
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 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
|
16 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
|
17 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
|
18 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
|
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 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
|
21 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
|
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 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
|
24 ===== |
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 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
26 $ cat >> $HGRCPATH << EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
27 > [storage] |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
28 > dirstate-v2.slow-path=allow |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
29 > EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
30 |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
31 #if no-dirstate-v1 |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
32 $ cat >> $HGRCPATH << EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
33 > [format] |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
34 > use-dirstate-v2=yes |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
35 > EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
36 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
37 $ cat >> $HGRCPATH << EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
38 > [format] |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
39 > use-dirstate-v2=no |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
40 > EOF |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
41 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
42 |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
43 #if dirstate-v2-rewrite |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
44 $ d2args="--config devel.dirstate.v2.data_update_mode=force-new" |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
45 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
46 #if dirstate-v2-append |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
47 $ d2args="--config devel.dirstate.v2.data_update_mode=force-append" |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
48 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
49 |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
50 |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
51 #if dirstate-v1 |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
52 $ cfg="devel.sync.dirstate.pre-read-file" |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
53 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
54 #if pre-all-read |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
55 $ cfg="devel.sync.dirstate.pre-read-file" |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
56 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
57 $ cfg="devel.sync.dirstate.post-docket-read-file" |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
58 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
59 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
60 |
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
|
61 $ 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
|
62 $ 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
|
63 $ 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
|
64 $ 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
|
65 |
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 $ 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
|
67 $ 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
|
68 $ 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
|
69 $ 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
|
70 $ 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
|
71 $ 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
|
72 $ 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
|
73 $ 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
|
74 @ 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
|
75 | 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
|
76 | 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
|
77 | 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
|
78 | 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
|
79 | 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
|
80 | 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
|
81 | |
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 | |
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 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 |
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 |
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 $ 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 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
|
97 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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 |
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 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
|
107 |
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 $ 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
|
109 $ 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
|
110 $ 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
|
111 |
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 $ 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
|
113 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
|
114 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
|
115 ? 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
|
116 ? 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
|
117 ? 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
|
118 $ 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
|
119 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
|
120 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
|
121 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
|
122 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
|
123 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
|
124 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
|
125 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
|
126 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
|
127 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
|
128 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
|
129 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
|
130 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
|
131 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
|
132 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
|
133 $ 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
|
134 $ 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
|
135 |
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 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
|
137 ============== |
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 |
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 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
|
140 ------------------- |
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 $ 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
|
143 $ 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
|
144 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
145 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
|
146 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
147 $ 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
|
148 > --config rhg.on-unsupported=abort \ |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
149 > --config ${cfg}=$TESTTMP/status-race-lock \ |
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
|
150 > & |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
151 $ $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
|
152 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
153 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
|
154 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
155 $ hg $d2args add dir/n |
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
|
156 $ 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
|
157 $ 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
|
158 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
159 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
|
160 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
161 $ 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
|
162 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
|
163 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
|
164 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
|
165 ? 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
|
166 ? 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
|
167 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
168 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
|
169 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
170 #if dirstate-v1 |
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
|
171 $ 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
|
172 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
|
173 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
|
174 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
|
175 ? 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
|
176 ? 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
|
177 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
178 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
179 #if rhg |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
180 #if pre-all-read |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
181 $ cat $TESTTMP/status-race-lock.out |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
182 A dir/n |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
183 A dir/o |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
184 R dir/nested/m |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
185 ? p |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
186 ? q |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
187 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
188 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
189 #if dirstate-v2-append |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
190 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
191 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
192 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
193 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
194 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
195 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
196 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
197 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
198 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
199 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
200 abort: dirstate-v2 parse error: not enough bytes on disk |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
201 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
202 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
203 #else |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
204 #if rust |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
205 #if dirstate-v2-rewrite |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
206 $ cat $TESTTMP/status-race-lock.out |
50238
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
207 A dir/n |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
208 A dir/o |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
209 R dir/nested/m |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
210 ? p |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
211 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
212 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
213 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
214 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
215 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
216 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
217 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
218 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
219 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
220 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
221 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
222 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
223 $ cat $TESTTMP/status-race-lock.out |
50237
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
224 A dir/n |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
225 A dir/o |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
226 R dir/nested/m |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
227 ? p |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
228 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
229 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
230 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
231 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
232 #endif |
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
|
233 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
234 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
|
235 |
7169ff59a2f8
dirstate: initial creation of a test file to check dirstate race read
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
236 $ 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
|
237 $ cd .. |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
238 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
239 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
|
240 ----------------------- |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
241 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
242 $ 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
|
243 $ cd race-with-commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
244 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
245 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
|
246 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
247 $ 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
|
248 > --config rhg.on-unsupported=abort \ |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
249 > --config ${cfg}=$TESTTMP/status-race-lock \ |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
250 > & |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
251 $ $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
|
252 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
253 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
|
254 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
255 $ hg status |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
256 A dir/o |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
257 R dir/nested/m |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
258 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
259 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
260 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
261 $ hg $d2args commit -m 'racing commit' |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
262 $ 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
|
263 $ wait |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
264 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
265 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
|
266 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
267 $ 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
|
268 @ 02a67a77ee9b racing commit |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
269 | |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
270 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
|
271 | |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
272 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
|
273 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
274 $ hg status |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
275 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
276 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
277 ? q |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
278 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
279 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
|
280 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
281 #if dirstate-v1 |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
282 $ cat $TESTTMP/status-race-lock.out |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
283 M dir/o (no-rhg !) |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
284 ? dir/n |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
285 ? p |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
286 ? q |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
287 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
288 warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !) |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
289 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
290 #if rhg |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
291 #if pre-all-read |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
292 $ cat $TESTTMP/status-race-lock.out |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
293 ? dir/n |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
294 ? p |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
295 ? q |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
296 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
297 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
298 #if dirstate-v2-append |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
299 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
300 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
301 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
302 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
303 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
304 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
305 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
306 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
307 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
308 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
309 abort: dirstate-v2 parse error: not enough bytes on disk |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
310 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
311 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
312 #else |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
313 #if rust |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
314 #if dirstate-v2-rewrite |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
315 $ cat $TESTTMP/status-race-lock.out |
50238
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
316 M dir/o |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
317 ? dir/n |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
318 ? p |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
319 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
320 $ cat $TESTTMP/status-race-lock.log |
50238
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
321 warning: ignoring unknown working parent 02a67a77ee9b! |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
322 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
323 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
324 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
325 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
326 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
327 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
328 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
329 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
330 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
331 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
332 $ cat $TESTTMP/status-race-lock.out |
50237
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
333 M dir/o |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
334 ? dir/n |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
335 ? p |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
336 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
337 $ cat $TESTTMP/status-race-lock.log |
50237
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
338 warning: ignoring unknown working parent 02a67a77ee9b! |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
339 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
340 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
341 #endif |
50230
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
342 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
343 final cleanup |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
344 |
e5fea4f1b052
dirstate: check dirstate race condition around commit
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50229
diff
changeset
|
345 $ 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
|
346 $ cd .. |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
347 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
348 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
|
349 ----------------------- |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
350 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
351 $ 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
|
352 $ cd race-with-update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
353 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
354 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
|
355 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
356 $ 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
|
357 > --config rhg.on-unsupported=abort \ |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
358 > --config ${cfg}=$TESTTMP/status-race-lock \ |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
359 > & |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
360 $ $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
|
361 do an update |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
362 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
363 $ hg status |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
364 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
365 R dir/nested/m |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
366 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
367 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
368 ? q |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
369 $ 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
|
370 @ 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
|
371 | |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
372 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
|
373 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
374 $ hg $d2args update --merge ".~1" |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
375 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
|
376 $ 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
|
377 $ wait |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
378 #if rhg dirstate-v2-append pre-some-read |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
379 $ hg log -GT '{node|short} {desc}\n' |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
380 @ 9a86dcbfb938 more files to have two commit |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
381 | |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
382 o 4f23db756b09 recreate a bunch of files to facilitate dirstate-v2 append |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
383 |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
384 $ hg status |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
385 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
386 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
387 ! dir/i |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
388 ! dir/j |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
389 ! dir/nested/h |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
390 ! dir2/k |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
391 ! dir2/l |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
392 ! g |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
393 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
394 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
395 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
396 #else |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
397 $ 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
|
398 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
|
399 | |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
400 @ 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
|
401 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
402 $ hg status |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
403 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
404 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
405 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
406 ? q |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
407 #endif |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
408 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
409 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
|
410 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
411 #if dirstate-v1 |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
412 $ cat $TESTTMP/status-race-lock.out |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
413 A dir/o |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
414 ? dir/n |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
415 ? p |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
416 ? q |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
417 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
418 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
419 #if rhg |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
420 #if pre-all-read |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
421 $ 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
|
422 A dir/o |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
423 ? dir/n |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
424 ? p |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
425 ? q |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
426 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
427 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
428 #if dirstate-v2-append |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
429 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
430 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
431 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
432 ! dir/i |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
433 ! dir/j |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
434 ! dir/nested/h |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
435 ! dir2/k |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
436 ! dir2/l |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
437 ! g |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
438 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
439 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
440 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
441 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
442 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
443 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
444 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
445 abort: dirstate-v2 parse error: not enough bytes on disk |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
446 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
447 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
448 #else |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
449 #if rust |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
450 #if dirstate-v2-rewrite |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
451 $ cat $TESTTMP/status-race-lock.out |
50238
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
452 A dir/o |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
453 ? dir/n |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
454 ? p |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
455 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
456 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
457 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
458 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
459 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
460 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
461 ! dir/i |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
462 ! dir/j |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
463 ! dir/nested/h |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
464 ! dir2/k |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
465 ! dir2/l |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
466 ! g |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
467 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
468 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
469 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
470 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
471 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
472 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
473 $ cat $TESTTMP/status-race-lock.out |
50237
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
474 A dir/o |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
475 ? dir/n |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
476 ? p |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
477 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
478 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
479 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
480 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
481 #endif |
50231
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
482 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
483 final cleanup |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
484 |
0f483a2c29e7
dirstate: check dirstate race condition around update
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50230
diff
changeset
|
485 $ 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
|
486 $ cd .. |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
487 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
488 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
|
489 -------------------------------------- |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
490 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
491 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
|
492 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
493 $ 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
|
494 $ cd race-with-status |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
495 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
496 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
|
497 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
498 $ 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
|
499 > --config rhg.on-unsupported=abort \ |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
500 > --config ${cfg}=$TESTTMP/status-race-lock \ |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
501 > & |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
502 $ $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
|
503 do an update |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
504 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
505 $ touch -t 200001020006 f |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
506 $ hg $d2args status |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
507 A dir/o |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
508 R dir/nested/m |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
509 ? dir/n |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
510 ? p |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
511 ? q |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
512 $ 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
|
513 $ wait |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
514 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
515 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
|
516 |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
517 #if dirstate-v1 |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
518 $ cat $TESTTMP/status-race-lock.out |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
519 A dir/o |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
520 R dir/nested/m |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
521 ? dir/n |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
522 ? p |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
523 ? q |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
524 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
525 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
526 #if rhg |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
527 #if pre-all-read |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
528 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
529 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
530 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
531 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
532 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
533 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
534 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
535 #else |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
536 #if dirstate-v2-append |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
537 $ 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
|
538 A dir/o |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
539 R dir/nested/m |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
540 ? dir/n |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
541 ? p |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
542 ? q |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
543 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
544 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
545 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
546 $ cat $TESTTMP/status-race-lock.log |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
547 abort: dirstate-v2 parse error: not enough bytes on disk |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
548 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
549 #endif |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
550 #else |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
551 #if rust |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
552 #if dirstate-v2-rewrite |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
553 $ cat $TESTTMP/status-race-lock.out |
50238
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
554 A dir/o |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
555 R dir/nested/m |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
556 ? dir/n |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
557 ? p |
c9066fc609ef
dirstate: deal with read-race for python code using rust object
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50237
diff
changeset
|
558 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
559 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
560 #else |
50235
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
561 $ cat $TESTTMP/status-race-lock.out |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
562 A dir/o |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
563 R dir/nested/m |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
564 ? dir/n |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
565 ? p |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
566 ? q |
385977432227
dirstate: add append/new-file variants in the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50233
diff
changeset
|
567 $ cat $TESTTMP/status-race-lock.log |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
568 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
569 #else |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
570 $ cat $TESTTMP/status-race-lock.out |
50237
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
571 A dir/o |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
572 R dir/nested/m |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
573 ? dir/n |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
574 ? p |
a3b1ab5f5dee
dirstate: deal with read-race for pure python code
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50235
diff
changeset
|
575 ? q |
50233
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
576 $ cat $TESTTMP/status-race-lock.log |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
577 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
578 #endif |
cf0d7cd6a6fa
dirstate: add v1-v2 variants to the dirstate's read race tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50232
diff
changeset
|
579 #endif |
50232
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
580 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
581 final cleanup |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
582 |
5bf6b8015035
dirstate: check dirstate race condition around status
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
50231
diff
changeset
|
583 $ 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
|
584 $ cd .. |