Skip to content

Commit

Permalink
add manual steps describing how to check launcher behavior regarding …
Browse files Browse the repository at this point in the history
…POSIX signals
  • Loading branch information
KtorZ committed Mar 18, 2019
1 parent 653d8ec commit d916efc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/manual/Cardano/Launcher/POSIXSpec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Cardano.Launcher.POSIX

## Goal

By default, the Haskell runtime and the `process` library we use to spawn new
processes in the launcher don't catch `SIGTERM` signals on a unix system. This
means that if we kill the launcher process, the sub-processes it has spawned
will endure.

What follows are steps which explains how to test that `SIGINT` and `SIGTERM`
signals are correctly handled on a unix system.

## Steps

### `SIGINT`

- Start the launcher using `stack exec -- cardano-wallet-launcher`
- In another terminal, run `ps -ef | grep cardano`, there should be three
processes running (the launcher, the wallet and the underlying chain
producer)
```
$ ps -ef | grep cardano
10983 4904 0 09:42 pts/1 00:00:00 /home/user/Documents/IOHK/cardano-wallet/.stack-work/install/x86_64-linux/lts-13.8/8.6.3/bin/cardano-wallet-launcher
11003 10983 75 09:42 pts/1 00:03:30 cardano-http-bridge start --port 8080
11071 10983 58 09:42 pts/1 00:02:41 cardano-wallet-server --wallet-server-port 8090 --http-bridge-port 8080 --network mainnet
```

- Send a `SIGINT` signal using by pressing `CTRL-C` in the first terminal
- Run `ps -ef | grep cardano`, there's no more process running: the launcher,
the wallet and the chain producer have all stopped.

### `SIGTERM`

- Start the launcher in background using `stack exec -- cardano-wallet-launcher &`
- Run `ps -ef | grep cardano` and lookup the `pid` of the launcher process (and
control that there are indeed three processes running: the launcher, the
wallet and the chain producer)
```
$ ps -ef | grep cardano
10983 4904 0 09:42 pts/1 00:00:00 /home/user/Documents/IOHK/cardano-wallet/.stack-work/install/x86_64-linux/lts-13.8/8.6.3/bin/cardano-wallet-launcher
11003 10983 75 09:42 pts/1 00:03:30 cardano-http-bridge start --port 8080
11071 10983 58 09:42 pts/1 00:02:41 cardano-wallet-server --wallet-server-port 8090 --http-bridge-port 8080 --network mainnet
```
- Send a `SIGTERM` signal to this pid using `kill <pid>`
- Run `ps -ef | grep cardano`, there's no more process running: the launcher,
the wallet and the chain producer have all stopped.

0 comments on commit d916efc

Please sign in to comment.