Mercurial > hg
view tests/test-histedit-no-backup.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 | faea9b1980d9 |
children | 6acbe86c6490 |
line wrap: on
line source
$ . "$TESTDIR/histedit-helpers.sh" Enable extension used by this test $ cat >>$HGRCPATH <<EOF > [extensions] > histedit= > EOF ========================================== Test history-editing-backup config option| ========================================== Repo setup: $ hg init foo $ cd foo $ echo first>file $ hg ci -qAm one $ echo second>>file $ hg ci -m two $ echo third>>file $ hg ci -m three $ echo forth>>file $ hg ci -m four $ hg log -G --style compact @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test | four | o 2 80d23dfa866d 1970-01-01 00:00 +0000 test | three | o 1 6153eb23e623 1970-01-01 00:00 +0000 test | two | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test one Test when `history-editing-backup` config option is enabled: $ hg histedit -r '36b4bdd91f5b' --commands - << EOF > pick 36b4bdd91f5b 0 one > pick 6153eb23e623 1 two > roll 80d23dfa866d 2 three > edit 7d5187087c79 3 four > EOF merging file Editing (7d5187087c79), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg histedit --abort 1 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg Test when `history-editing-backup` config option is not enabled Enable config option: $ cat >>$HGRCPATH <<EOF > [ui] > history-editing-backup=False > EOF $ hg histedit -r '36b4bdd91f5b' --commands - << EOF > pick 36b4bdd91f5b 0 one > pick 6153eb23e623 1 two > roll 80d23dfa866d 2 three > edit 7d5187087c79 3 four > EOF merging file Editing (7d5187087c79), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg histedit --abort 1 files updated, 0 files merged, 0 files removed, 0 files unresolved