Mercurial > hg
view tests/test-eolfilename.t @ 40036:acf5dbe39478
showstack: also handle SIGALRM
This is looking *very* handy when debugging mysterious hangs in a
test: you can wrap a hanging invocation in
`perl -e 'alarm shift @ARGV; exec @ARGV' 1`
for example, a hanging `hg pull` becomes
`perl -e 'alarm shift @ARGV; exec @ARGV' 1 hg pull`
where the `1` is the timeout in seconds before the process will be hit
with SIGALRM. After making that edit to the test file, you can then
use --extra-config-opt on run-tests.py to globaly enable showstack
during the test run, so you'll get full stack traces as you force your
hg to exit.
I wonder (but only a little, not enough to take action just yet) if we
should wire up some scaffolding in run-tests itself to automatically
wrap all commands in alarm(3) somehow to avoid hangs in the future?
Differential Revision: https://phab.mercurial-scm.org/D4870
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 03 Oct 2018 16:03:16 -0400 |
parents | dbf31732ef64 |
children | 3175b0e0058b |
line wrap: on
line source
#require eol-in-paths https://bz.mercurial-scm.org/352 test issue352 $ hg init foo $ cd foo $ A=`printf 'he\rllo'` $ echo foo > "$A" $ hg add adding he\r (no-eol) (esc) llo abort: '\n' and '\r' disallowed in filenames: 'he\rllo' [255] $ hg ci -A -m m adding he\r (no-eol) (esc) llo abort: '\n' and '\r' disallowed in filenames: 'he\rllo' [255] $ rm "$A" $ echo foo > "hell > o" $ hg add adding hell o abort: '\n' and '\r' disallowed in filenames: 'hell\no' [255] $ hg ci -A -m m adding hell o abort: '\n' and '\r' disallowed in filenames: 'hell\no' [255] $ echo foo > "$A" $ hg debugwalk -v * matcher: <alwaysmatcher> f he\r (no-eol) (esc) llo he\r (no-eol) (esc) llo f hell o hell o $ echo bla > quickfox $ hg add quickfox $ hg ci -m 2 $ A=`printf 'quick\rfox'` $ hg cp quickfox "$A" abort: '\n' and '\r' disallowed in filenames: 'quick\rfox' [255] $ hg mv quickfox "$A" abort: '\n' and '\r' disallowed in filenames: 'quick\rfox' [255] https://bz.mercurial-scm.org/2036 $ cd .. test issue2039 $ hg init bar $ cd bar $ cat <<EOF >> $HGRCPATH > [extensions] > color = > [color] > mode = ansi > EOF $ A=`printf 'foo\nbar'` $ B=`printf 'foo\nbar.baz'` $ touch "$A" $ touch "$B" $ hg status --color=always \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc) \x1b[0;35;1;4mbar\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mfoo\x1b[0m (esc) \x1b[0;35;1;4mbar.baz\x1b[0m (esc) $ cd ..