##// END OF EJS Templates
nodemap: add a test about nodemap "vacuum" during stream clone...
marmoute -
r47750:dc95c8ca default
parent child Browse files
Show More
@@ -966,3 +966,100 b' Clean up after the test.'
966 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_1"
966 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_1"
967 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_2"
967 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_2"
968 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_3"
968 $ rm -f "$HG_TEST_STREAM_WALKED_FILE_3"
969
970 full regeneration
971 -----------------
972
973 A full nodemap is generated
974
975 (ideally this test would append enough data to make sure the nodemap data file
976 get changed, however to make thing simpler we will force the regeneration for
977 this test.
978
979 Check the initial state
980
981 $ f --size test-repo/.hg/store/00changelog*
982 test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !)
983 test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !)
984 test-repo/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !)
985 test-repo/.hg/store/00changelog.d: size=376950 (zstd !)
986 test-repo/.hg/store/00changelog.d: size=368949 (no-zstd !)
987 test-repo/.hg/store/00changelog.i: size=320448
988 test-repo/.hg/store/00changelog.n: size=70
989 $ hg -R test-repo debugnodemap --metadata | tee server-metadata-2.txt
990 uid: * (glob)
991 tip-rev: 5006
992 tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b
993 data-length: 121344 (rust !)
994 data-unused: 192 (rust !)
995 data-unused: 0.158% (rust !)
996 data-length: 121152 (no-rust no-pure !)
997 data-unused: 0 (no-rust no-pure !)
998 data-unused: 0.000% (no-rust no-pure !)
999 data-length: 121344 (pure !)
1000 data-unused: 192 (pure !)
1001 data-unused: 0.158% (pure !)
1002
1003 Performe the mix of clone and full refresh of the nodemap, so that the files
1004 (and filenames) are different between listing time and actual transfer time.
1005
1006 $ (hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone-race-2 --debug 2>> clone-output-2 | egrep '00(changelog|manifest)' >> clone-output-2; touch $HG_TEST_STREAM_WALKED_FILE_3) &
1007 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
1008 $ rm test-repo/.hg/store/00changelog.n
1009 $ rm test-repo/.hg/store/00changelog-*.nd
1010 $ hg -R test-repo/ debugupdatecache
1011 $ touch $HG_TEST_STREAM_WALKED_FILE_2
1012 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
1013 $ cat clone-output-2
1014 remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output rust !)
1015 remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output pure !)
1016 remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-pure no-rust !)
1017 abort: pull failed on remote (known-bad-output !)
1018 adding [s] undo.backup.00manifest.n (70 bytes) (known-bad-output !)
1019 adding [s] undo.backup.00changelog.n (70 bytes) (known-bad-output !)
1020 adding [s] 00manifest.n (70 bytes)
1021 adding [s] 00manifest.d (492 KB) (zstd !)
1022 adding [s] 00manifest.d (452 KB) (no-zstd !)
1023 adding [s] 00manifest-*.nd (118 KB) (glob) (rust !)
1024 adding [s] 00manifest-*.nd (118 KB) (glob) (pure !)
1025 remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output rust !)
1026 remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-pure no-rust !)
1027 adding [s] 00changelog.n (70 bytes) (pure !)
1028 adding [s] 00changelog.d (360 KB) (no-zstd !)
1029 remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output pure !)
1030
1031 Check the result.
1032
1033 $ f --size stream-clone-race-2/.hg/store/00changelog*
1034 stream-clone-race-2/.hg/store/00changelog*: file not found (known-bad-output !)
1035
1036 $ hg -R stream-clone-race-2 debugnodemap --metadata | tee client-metadata-2.txt
1037 abort: repository stream-clone-race-2 not found (known-bad-output !)
1038
1039 We get a usable nodemap, so no rewrite would be needed and the metadata should be identical
1040 (ie: the following diff should be empty)
1041
1042 $ diff -u server-metadata-2.txt client-metadata-2.txt
1043 --- server-metadata-2.txt * (glob) (known-bad-output !)
1044 +++ client-metadata-2.txt * (glob) (known-bad-output !)
1045 @@ -1,6 +0,0 @@ (known-bad-output !)
1046 -uid: * (glob) (known-bad-output !)
1047 -tip-rev: 5006 (known-bad-output !)
1048 -tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b (known-bad-output !)
1049 -data-length: 121344 (known-bad-output rust !)
1050 -data-unused: 192 (known-bad-output rust !)
1051 -data-unused: 0.158% (known-bad-output rust !)
1052 -data-length: 121344 (known-bad-output pure !)
1053 -data-unused: 192 (known-bad-output pure !)
1054 -data-unused: 0.158% (known-bad-output pure !)
1055 -data-length: 121152 (known-bad-output no-rust no-pure !)
1056 -data-unused: 0 (known-bad-output no-rust no-pure !)
1057 -data-unused: 0.000% (known-bad-output no-rust no-pure !)
1058 [1]
1059
1060 Clean up after the test
1061
1062 $ rm -f $HG_TEST_STREAM_WALKED_FILE_1
1063 $ rm -f $HG_TEST_STREAM_WALKED_FILE_2
1064 $ rm -f $HG_TEST_STREAM_WALKED_FILE_3
1065
General Comments 0
You need to be logged in to leave comments. Login now