Show More
@@ -27,8 +27,6 b' Dummy extension simulating unsafe long r' | |||||
27 | > with ui.uninterruptible(): |
|
27 | > with ui.uninterruptible(): | |
28 | > testing.write_file(sync_file, b'%d' % os.getpid()) |
|
28 | > testing.write_file(sync_file, b'%d' % os.getpid()) | |
29 | > testing.wait_file(done_file) |
|
29 | > testing.wait_file(done_file) | |
30 | > # make sure we get rescheduled and the signal get a chance to be handled |
|
|||
31 | > time.sleep(0.1) |
|
|||
32 | > ui.warn(b"end of unsafe operation\n") |
|
30 | > ui.warn(b"end of unsafe operation\n") | |
33 | > ui.warn(b"%d second(s) passed\n" % int(time.time() - start)) |
|
31 | > ui.warn(b"%d second(s) passed\n" % int(time.time() - start)) | |
34 | > EOF |
|
32 | > EOF | |
@@ -42,14 +40,26 b' Dummy extension simulating unsafe long r' | |||||
42 | > fi |
|
40 | > fi | |
43 | > "$RUNTESTDIR/testlib/wait-on-file" 10 "$SYNC_FILE" || exit 2 |
|
41 | > "$RUNTESTDIR/testlib/wait-on-file" 10 "$SYNC_FILE" || exit 2 | |
44 | > kill -s \$SIG \`cat "$SYNC_FILE"\` |
|
42 | > kill -s \$SIG \`cat "$SYNC_FILE"\` | |
45 | > sleep 1 |
|
|||
46 | > touch "$DONE_FILE" |
|
|||
47 | > EOF |
|
43 | > EOF | |
48 |
|
44 | |||
49 | #if no-windows |
|
45 | #if no-windows | |
50 |
$ |
|
46 | $ chmod +x send-signal.sh | |
51 | #endif |
|
47 | #endif | |
52 |
|
48 | |||
|
49 | $ cat > wait-signal.sh << 'EOF' | |||
|
50 | > #!/bin/sh | |||
|
51 | > (hg wait-signal 2>&1; echo [$?]) | { | |||
|
52 | > read line | |||
|
53 | > touch "$DONE_FILE" | |||
|
54 | > echo "$line" | |||
|
55 | > cat | |||
|
56 | > } | |||
|
57 | > EOF | |||
|
58 | ||||
|
59 | #if no-windows | |||
|
60 | $ chmod +x wait-signal.sh | |||
|
61 | #endif | |||
|
62 | ||||
53 | Kludge to emulate timeout(1) which is not generally available. |
|
63 | Kludge to emulate timeout(1) which is not generally available. | |
54 |
|
64 | |||
55 | Set up repository |
|
65 | Set up repository | |
@@ -60,11 +70,10 b' Set up repository' | |||||
60 | > wait_ext = $TESTTMP/wait_ext.py |
|
70 | > wait_ext = $TESTTMP/wait_ext.py | |
61 | > EOF |
|
71 | > EOF | |
62 |
|
72 | |||
63 |
|
||||
64 | Test ctrl-c |
|
73 | Test ctrl-c | |
65 | $ rm -f $SYNC_FILE $DONE_FILE |
|
74 | $ rm -f $SYNC_FILE $DONE_FILE | |
66 | $ sh -c "../send-signal.sh INT" & |
|
75 | $ sh -c "../send-signal.sh INT" & | |
67 |
$ |
|
76 | $ ../wait-signal.sh | |
68 | interrupted! |
|
77 | interrupted! | |
69 | [255] |
|
78 | [255] | |
70 |
|
79 | |||
@@ -75,7 +84,7 b' Test ctrl-c' | |||||
75 |
|
84 | |||
76 | $ rm -f $SYNC_FILE $DONE_FILE |
|
85 | $ rm -f $SYNC_FILE $DONE_FILE | |
77 | $ sh -c "../send-signal.sh INT" & |
|
86 | $ sh -c "../send-signal.sh INT" & | |
78 |
$ |
|
87 | $ ../wait-signal.sh | |
79 | interrupted! |
|
88 | interrupted! | |
80 | [255] |
|
89 | [255] | |
81 |
|
90 | |||
@@ -86,7 +95,7 b' Test ctrl-c' | |||||
86 |
|
95 | |||
87 | $ rm -f $SYNC_FILE $DONE_FILE |
|
96 | $ rm -f $SYNC_FILE $DONE_FILE | |
88 | $ sh -c "../send-signal.sh INT" & |
|
97 | $ sh -c "../send-signal.sh INT" & | |
89 |
$ |
|
98 | $ ../wait-signal.sh | |
90 | shutting down cleanly |
|
99 | shutting down cleanly | |
91 | press ^C again to terminate immediately (dangerous) |
|
100 | press ^C again to terminate immediately (dangerous) | |
92 | end of unsafe operation |
|
101 | end of unsafe operation |
General Comments 0
You need to be logged in to leave comments.
Login now