Patchwork D8190: nodemap: test that concurrent process don't see the pending transaction

login
register
mail settings
Submitter phabricator
Date April 1, 2020, 3:21 p.m.
Message ID <cb75baa6cf252a377279a5d42e0e329c@localhost.localdomain>
Download mbox | patch
Permalink /patch/45961/
State Not Applicable
Headers show

Comments

phabricator - April 1, 2020, 3:21 p.m.
Closed by commit rHGdd5b47fb0860: nodemap: test that concurrent process don&#039;t see the pending transaction (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8190?vs=20393&id=20932

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8190/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8190

AFFECTED FILES
  tests/test-persistent-nodemap.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: martinvonz, durin42, mercurial-devel

Patch

diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t
--- a/tests/test-persistent-nodemap.t
+++ b/tests/test-persistent-nodemap.t
@@ -317,3 +317,39 @@ 
   data-unused: 192 (pure !)
   data-unused: 192 (rust !)
   data-unused: 0 (no-pure no-rust !)
+
+Another process does not see the pending nodemap content during run.
+
+  $ PATH=$RUNTESTDIR/testlib/:$PATH
+  $ echo qpoasp > a
+  $ hg ci -m a2 \
+  > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
+  > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
+
+(read the repository while the commit transaction is pending)
+
+  $ wait-on-file 20 sync-txn-pending && \
+  > hg debugnodemap --metadata && \
+  > wait-on-file 20 sync-txn-close sync-repo-read
+  uid: ???????????????? (glob)
+  tip-rev: 5004
+  tip-node: ba87cd9559559e4b91b28cb140d003985315e031
+  data-length: 123328 (pure !)
+  data-length: 123328 (rust !)
+  data-length: 123136 (no-pure no-rust !)
+  data-unused: 192 (pure !)
+  data-unused: 192 (rust !)
+  data-unused: 0 (no-pure no-rust !)
+  $ hg debugnodemap --metadata
+  uid: ???????????????? (glob)
+  tip-rev: 5005
+  tip-node: bae4d45c759e30f1cb1a40e1382cf0e0414154db
+  data-length: 123584 (pure !)
+  data-length: 123584 (rust !)
+  data-length: 123136 (no-pure no-rust !)
+  data-unused: 448 (pure !)
+  data-unused: 448 (rust !)
+  data-unused: 0 (no-pure no-rust !)
+
+  $ cat output.txt
+