Patchwork D8065: test: simplify test-amend.t to avoid race condition

login
register
mail settings
Submitter phabricator
Date Feb. 5, 2020, 4:59 p.m.
Message ID <96885d025e3dbfa90e1e27921f57166b@localhost.localdomain>
Download mbox | patch
Permalink /patch/44961/
State Not Applicable
Headers show

Comments

phabricator - Feb. 5, 2020, 4:59 p.m.
Closed by commit rHG63a4d43db8d0: test: simplify test-amend.t to avoid race condition (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/D8065?vs=19814&id=19914

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

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

AFFECTED FILES
  tests/test-amend.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -485,14 +485,14 @@ 
   $ echo r0 > foo; hg commit -qAm "r0"
   $ echo alpha > foo; hg commit -qm "alpha"
   $ echo beta >> foo
-  $ cat > $TESTTMP/sleepy_editor.sh <<EOF
+  $ cat > $TESTTMP/touchy_editor.sh <<EOF
+  > sleep 1
+  > echo delta >> $TESTTMP/modify-during-amend/foo
+  > sleep 1
   > echo hi > "\$1"
-  > sleep 3
+  > sleep 1
   > EOF
-  $ HGEDITOR="sh $TESTTMP/sleepy_editor.sh" hg commit --amend &
-  $ sleep 1
-  $ echo delta >> foo
-  $ sleep 3
+  $ HGEDITOR="sh $TESTTMP/touchy_editor.sh" hg commit --amend
   $ if (hg diff -c . | grep 'delta' >/dev/null) || [ -n "$(hg status)" ]; then
   >   echo "OK."
   > else