Mercurial > hg
annotate tests/test-clone-uncompressed.t @ 31971:73e9328e5307
obsolescence: add test case D-3 for obsolescence markers exchange
About 3 years ago, in August 2014, the logic to select what markers to select on
push was ported from the evolve extension to Mercurial core. However, for some
unclear reasons, the tests for that logic were not ported alongside.
I realised it a couple of weeks ago while working on another push related issue.
I've made a clean up pass on the tests and they are now ready to integrate the
core test suite. This series of changesets do not change any logic. I just adds
test for logic that has been around for about 10 versions of Mercurial.
They are a patch for each test case. It makes it easier to review and postpone
one with documentation issues without rejecting the wholes series.
This patch introduce case D3: missing prune target (prune not in "pushed set")
Each test case comes it in own test file. It help parallelism and does not
introduce a significant overhead from having a single unified giant test file.
Here are timing to support this claim.
# Multiple test files version:
# run-tests.py --local -j 1 test-exchange-*.t
53.40s user 6.82s system 85% cpu 1:10.76 total
52.79s user 6.97s system 85% cpu 1:09.97 total
52.94s user 6.82s system 85% cpu 1:09.69 total
# Single test file version:
# run-tests.py --local -j 1 test-exchange-obsmarkers.t
52.97s user 6.85s system 85% cpu 1:10.10 total
52.64s user 6.79s system 85% cpu 1:09.63 total
53.70s user 7.00s system 85% cpu 1:11.17 total
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 10 Apr 2017 16:54:43 +0200 |
parents | e7a35f18d91f |
children | 33b7283a3828 |
rev | line source |
---|---|
27897
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 #require serve |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 |
28389
9ab45fbe045e
bdiff: (pure) support array.array arrays (issue5130)
timeless <timeless@mozdev.org>
parents:
27897
diff
changeset
|
3 Initialize repository |
9ab45fbe045e
bdiff: (pure) support array.array arrays (issue5130)
timeless <timeless@mozdev.org>
parents:
27897
diff
changeset
|
4 the status call is to check for issue5130 |
9ab45fbe045e
bdiff: (pure) support array.array arrays (issue5130)
timeless <timeless@mozdev.org>
parents:
27897
diff
changeset
|
5 |
27897
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ hg init server |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 $ cd server |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 $ touch foo |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 $ hg -q commit -A -m initial |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 >>> for i in range(1024): |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 ... with open(str(i), 'wb') as fh: |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 ... fh.write(str(i)) |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ hg -q commit -A -m 'add a lot of files' |
28389
9ab45fbe045e
bdiff: (pure) support array.array arrays (issue5130)
timeless <timeless@mozdev.org>
parents:
27897
diff
changeset
|
14 $ hg st |
27897
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 $ hg serve -p $HGPORT -d --pid-file=hg.pid |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 $ cat hg.pid >> $DAEMON_PIDS |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 $ cd .. |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 Basic clone |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1 |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 streaming all changes |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 1027 files to transfer, 96.3 KB of data |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 transferred 96.3 KB in * seconds (*/sec) (glob) |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 searching for changes |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 no changes found |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 Clone with background file closing enabled |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --uncompressed -U http://localhost:$HGPORT clone-background | grep -v adding |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 using http://localhost:$HGPORT/ |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 sending capabilities command |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 sending branchmap command |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 streaming all changes |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 sending stream_out command |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 1027 files to transfer, 96.3 KB of data |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 starting 4 threads for background file closing |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 transferred 96.3 KB in * seconds (*/sec) (glob) |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 query 1; heads |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 sending batch command |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 searching for changes |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 all remote heads known locally |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
43 no changes found |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 sending getbundle command |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 bundle2-input-bundle: with-transaction |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
29064
9dc27a334fb1
bundle2: properly request phases during getbundle
Mike Hommey <mh@glandium.org>
parents:
28518
diff
changeset
|
47 bundle2-input-part: total payload size 58 |
27897
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 bundle2-input-bundle: 1 parts total |
2fdbf22a1b63
streamclone: use backgroundfilecloser (issue4889)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 checking for updated bookmarks |
28517
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
51 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
52 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
53 Stream clone while repo is changing: |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
54 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
55 $ mkdir changing |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
56 $ cd changing |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
57 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
58 extension for delaying the server process so we reliably can modify the repo |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
59 while cloning |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
60 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
61 $ cat > delayer.py <<EOF |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
62 > import time |
31252
e7a35f18d91f
vfs: use 'vfs' module directly in 'test-clone-uncompressed'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
29064
diff
changeset
|
63 > from mercurial import extensions, vfs |
28517
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
64 > def __call__(orig, self, path, *args, **kwargs): |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
65 > if path == 'data/f1.i': |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
66 > time.sleep(2) |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
67 > return orig(self, path, *args, **kwargs) |
31252
e7a35f18d91f
vfs: use 'vfs' module directly in 'test-clone-uncompressed'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
29064
diff
changeset
|
68 > extensions.wrapfunction(vfs.vfs, '__call__', __call__) |
28517
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
69 > EOF |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
70 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
71 prepare repo with small and big file to cover both code paths in emitrevlogdata |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
72 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
73 $ hg init repo |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
74 $ touch repo/f1 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
75 $ $TESTDIR/seq.py 50000 > repo/f2 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
76 $ hg -R repo ci -Aqm "0" |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
77 $ hg -R repo serve -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
78 $ cat hg.pid >> $DAEMON_PIDS |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
79 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
80 clone while modifying the repo between stating file with write lock and |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
81 actually serving file content |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
82 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
83 $ hg clone -q --uncompressed -U http://localhost:$HGPORT1 clone & |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
84 $ sleep 1 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
85 $ echo >> repo/f1 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
86 $ echo >> repo/f2 |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
87 $ hg -R repo ci -m "1" |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
88 $ wait |
95163ababeb8
tests: add test of stream clone of repo that is changing
Mads Kiilerich <madski@unity3d.com>
parents:
28389
diff
changeset
|
89 $ hg -R clone id |
28518
aa440c3d7c5d
streamclone: fix error when store files grow while stream cloning
Mads Kiilerich <madski@unity3d.com>
parents:
28517
diff
changeset
|
90 000000000000 |