# HG changeset patch # User Yuya Nishihara # Date 2017-02-25 03:33:37 # Node ID 92bca12328d153160770db605e679ed615e155d5 # Parent 7074589cf22a8083504f47bda8a0e7f01ad804af 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. diff --git a/tests/test-simple-update.t b/tests/test-simple-update.t --- a/tests/test-simple-update.t +++ b/tests/test-simple-update.t @@ -56,3 +56,37 @@ update to rev 0 with a date [255] $ cd .. + +update with worker processes + +#if no-windows + + $ cat < 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 <> .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