This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 141ceec0 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

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

Insted on relying on sleep, we could simply have the editor do the file change.
This remove the reliance on "sleep" and avoid test failing on heavy load
machine.

To test this, I reverted the code change in 5558e3437872 and the test started
failing again.

Differential Revision: https://phab.mercurial-scm.org/D8065
parent 9659ec161644
......@@ -485,5 +485,8 @@
$ 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"
......@@ -489,3 +492,3 @@
> echo hi > "\$1"
> sleep 3
> sleep 1
> EOF
......@@ -491,8 +494,5 @@
> 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment