Patchwork D10636: tests: stabilize test-persistent-nodemap.t on Windows

login
register
mail settings
Submitter phabricator
Date May 3, 2021, 6:22 p.m.
Message ID <differential-rev-PHID-DREV-fdzns3yhnukxkg3h6nr6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48954/
State Superseded
Headers show

Comments

phabricator - May 3, 2021, 6:22 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Several issues here:
  
  - Hooks can't invoke shell scripts on Windows, so use `sh` to launch
  - `dd` in MSYS only recognizes `status=noxfer`
  - The `PATH` updating triggered a massive slowdown, but is no longer needed
  
  I have no idea why, but removing the `PATH` update substantially increased the
  speed of the test.  It was running finishing at ~4:30 with `--debug` and ~14:50
  without it, but now completes in ~2:20 on my Windows laptop.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  tests/test-persistent-nodemap.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, 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
@@ -474,17 +474,16 @@ 
 
 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.pretxnclose=sh \"$RUNTESTDIR/testlib/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 && \
+  $ sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-pending && \
   > hg debugnodemap --metadata && \
-  > wait-on-file 20 sync-txn-close sync-repo-read
+  > sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-close sync-repo-read
   uid: ???????????????? (glob)
   tip-rev: 5004
   tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
@@ -792,7 +791,9 @@ 
   $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd`
   $ f -s $datafilepath
   corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob)
-  $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=none
+  $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=noxfer
+  10+0 records in
+  10+0 records out
   $ mv $datafilepath-tmp $datafilepath
   $ f -s $datafilepath
   corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob)