Without surprise, this is broken :-)
Now that it is tested, we can fix it.
Alphare |
hg-reviewers |
Without surprise, this is broken :-)
Now that it is tested, we can fix it.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-transaction-safety.t (94 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
a5d404d228ab | 98643e811106 | Pierre-Yves David | May 3 2021, 6:34 AM |
Test transaction safety | Test transaction safety | ||||
======================= | ======================= | ||||
#testcases revlogv1 revlogv2 | |||||
#if revlogv1 | |||||
$ cat << EOF >> $HGRCPATH | |||||
> [experimental] | |||||
> revlogv2=no | |||||
> EOF | |||||
#endif | |||||
#if revlogv2 | |||||
$ cat << EOF >> $HGRCPATH | |||||
> [experimental] | |||||
> revlogv2=enable-unstable-format-and-corrupt-my-data | |||||
> EOF | |||||
#endif | |||||
This test basic case to make sure external process do not see transaction | This test basic case to make sure external process do not see transaction | ||||
content until it is committed. | content until it is committed. | ||||
# TODO: also add an external reader accessing revlog files while they are written | # TODO: also add an external reader accessing revlog files while they are written | ||||
# (instead of during transaction finalisation) | # (instead of during transaction finalisation) | ||||
# TODO: also add stream clone and hardlink clone happening during these transaction. | # TODO: also add stream clone and hardlink clone happening during these transaction. | ||||
check this is true for the initial commit (inline → inline) | check this is true for the initial commit (inline → inline) | ||||
----------------------------------------------------------- | ----------------------------------------------------------- | ||||
the repository should still be inline (for relevant format) | the repository should still be inline (for relevant format) | ||||
$ make_one_commit first | $ make_one_commit first | ||||
pre-commit: -1 | pre-commit: -1 | ||||
external: -1 | external: -1 (revlogv1 !) | ||||
external: 0 first (revlogv2 known-bad-output !) | |||||
internal: 0 first | internal: 0 first | ||||
post-tr: 0 first | post-tr: 0 first | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
check this is true for extra commit (inline → inline) | check this is true for extra commit (inline → inline) | ||||
----------------------------------------------------- | ----------------------------------------------------- | ||||
the repository should still be inline (for relevant format) | the repository should still be inline (for relevant format) | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
$ make_one_commit second | $ make_one_commit second | ||||
pre-commit: 0 first | pre-commit: 0 first | ||||
external: 0 first | external: 0 first (revlogv1 !) | ||||
external: 1 second (revlogv2 known-bad-output !) | |||||
internal: 1 second | internal: 1 second | ||||
post-tr: 1 second | post-tr: 1 second | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
check this is true for a small pull (inline → inline) | check this is true for a small pull (inline → inline) | ||||
----------------------------------------------------- | ----------------------------------------------------- | ||||
the repository should still be inline (for relevant format) | the repository should still be inline (for relevant format) | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
$ make_one_pull 3 | $ make_one_pull 3 | ||||
pre-commit: 1 second | pre-commit: 1 second | ||||
warning: repository is unrelated | warning: repository is unrelated | ||||
external: 1 second | external: 1 second (revlogv1 !) | ||||
external: 5 r3 (revlogv2 known-bad-output !) | |||||
internal: 5 r3 | internal: 5 r3 | ||||
post-tr: 5 r3 | post-tr: 5 r3 | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
Make a large pull (inline → no-inline) | Make a large pull (inline → no-inline) | ||||
--------------------------------------- | --------------------------------------- | ||||
the repository should no longer be inline (for relevant format) | the repository should no longer be inline (for relevant format) | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
flags : inline | flags : inline | ||||
#endif | |||||
$ make_one_pull 400 | $ make_one_pull 400 | ||||
pre-commit: 5 r3 | pre-commit: 5 r3 | ||||
external: 5 r3 | external: 5 r3 (revlogv1 !) | ||||
external: 402 r400 (revlogv2 known-bad-output !) | |||||
internal: 402 r400 | internal: 402 r400 | ||||
post-tr: 402 r400 | post-tr: 402 r400 | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
[1] | [1] | ||||
#endif | |||||
check this is true for extra commit (no-inline → no-inline) | check this is true for extra commit (no-inline → no-inline) | ||||
----------------------------------------------------------- | ----------------------------------------------------------- | ||||
the repository should no longer be inline (for relevant format) | the repository should no longer be inline (for relevant format) | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
[1] | [1] | ||||
#endif | |||||
$ make_one_commit third | $ make_one_commit third | ||||
pre-commit: 402 r400 | pre-commit: 402 r400 | ||||
external: 402 r400 | external: 402 r400 (revlogv1 !) | ||||
external: 403 third (revlogv2 known-bad-output !) | |||||
internal: 403 third | internal: 403 third | ||||
post-tr: 403 third | post-tr: 403 third | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
[1] | [1] | ||||
#endif | |||||
Make a pull (not-inline → no-inline) | Make a pull (not-inline → no-inline) | ||||
------------------------------------- | ------------------------------------- | ||||
the repository should no longer be inline (for relevant format) | the repository should no longer be inline (for relevant format) | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
[1] | [1] | ||||
#endif | |||||
$ make_one_pull tip | $ make_one_pull tip | ||||
pre-commit: 403 third | pre-commit: 403 third | ||||
external: 403 third | external: 403 third (revlogv1 !) | ||||
external: 503 r500 (revlogv2 known-bad-output !) | |||||
internal: 503 r500 | internal: 503 r500 | ||||
post-tr: 503 r500 | post-tr: 503 r500 | ||||
#if revlogv1 | |||||
$ hg debugrevlog -c | grep inline | $ hg debugrevlog -c | grep inline | ||||
[1] | [1] | ||||
#endif |