Augment every task spawned by Service with on_exit (#3581)

* Augment every task spawned by Service with `on_exit`

* Add CI test that the node exits
This commit is contained in:
Bastian Köcher
2019-09-10 12:05:54 +02:00
committed by GitHub
parent a4ba356047
commit 86b3f2e1a7
4 changed files with 38 additions and 18 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Script that checks that a node exits after `SIGINT` was send.
set -e
cargo build --release
./target/release/substrate --dev &
PID=$!
# Let the chain running for 60 seconds
sleep 60
# Send `SIGINT` and give the process 30 seconds to end
kill -INT $PID
timeout 30 tail --pid=$PID -f /dev/null