worker: add basic test to ensure child processes are managed well
This should catch the bug fixed by "worker: ignore meaningless exit status
indication returned by os.waitpid()."
Before, worker.py was untested since test repositories are relatively small.
--- a/tests/test-simple-update.t Thu Feb 23 11:23:17 2017 -0800
+++ b/tests/test-simple-update.t Sat Feb 25 12:33:37 2017 +0900
@@ -56,3 +56,37 @@
[255]
$ cd ..
+
+update with worker processes
+
+#if no-windows
+
+ $ cat <<EOF > forceworker.py
+ > from mercurial import extensions, worker
+ > def nocost(orig, ui, costperop, nops):
+ > return worker._numworkers(ui) > 1
+ > def uisetup(ui):
+ > extensions.wrapfunction(worker, 'worthwhile', nocost)
+ > EOF
+
+ $ hg init worker
+ $ cd worker
+ $ cat <<EOF >> .hg/hgrc
+ > [extensions]
+ > forceworker = $TESTTMP/forceworker.py
+ > [worker]
+ > numcpus = 4
+ > EOF
+ $ for i in `python $TESTDIR/seq.py 1 100`; do
+ > echo $i > $i
+ > done
+ $ hg ci -qAm 'add 100 files'
+
+ $ hg update null
+ 0 files updated, 0 files merged, 100 files removed, 0 files unresolved
+ $ hg update
+ 100 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+ $ cd ..
+
+#endif