##// END OF EJS Templates
tests: prevent test-hup from hanging forever if the transaction does not start...
Pierre-Yves David -
r20896:9fae0183 default
parent child Browse files
Show More
@@ -1,28 +1,37
1 1 Test hangup signal in the middle of transaction
2 2
3 3 $ "$TESTDIR/hghave" serve fifo || exit 80
4 4 $ hg init
5 5 $ mkfifo p
6 6 $ hg serve --stdio < p 1>out 2>&1 &
7 7 $ P=$!
8 8
9 9 Do test while holding fifo open
10 10
11 11 $ (
12 12 > echo lock
13 13 > echo addchangegroup
14 > while [ ! -s .hg/store/journal ]; do sleep 0; done
14 > start=`date +%s`
15 > # 10 second seems much enough to let the server catch up
16 > deadline=`expr $start + 10`
17 > while [ ! -s .hg/store/journal ]; do
18 > sleep 0;
19 > if [ `date +%s` -gt $deadline ]; then
20 > echo "transaction did not start after 10 seconds" >&2;
21 > exit 1;
22 > fi
23 > done
15 24 > kill -HUP $P
16 25 > ) > p
17 26
18 27 $ wait
19 28 $ cat out
20 29 0
21 30 0
22 31 adding changesets
23 32 transaction abort!
24 33 rollback completed
25 34 killed!
26 35
27 36 $ echo .hg/* .hg/store/*
28 37 .hg/00changelog.i .hg/journal.bookmarks .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a .hg/store/journal.phaseroots
General Comments 0
You need to be logged in to leave comments. Login now