diff --git a/test/e2e/README.md b/test/e2e/README.md index d17864611..50f248c51 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -82,11 +82,36 @@ func init() { ### Debugging Failures -If a command or test fails, the runner simply exits with an error message and non-zero status code. The testnet is left running with data in the testnet directory, and can be inspected with e.g. `docker ps`, `docker logs`, or `./build/runner -f logs` or `tail`. To shut down and remove the testnet, run `./build/runner -f cleanup`. +If a command or test fails, the runner simply exits with an error message and +non-zero status code. The testnet is left running with data in the testnet +directory, and can be inspected with e.g. `docker ps`, `docker logs`, or +`./build/runner -f logs` or `tail`. To shut down and remove the +testnet, run `./build/runner -f cleanup`. + +If the standard `log_level` is not detailed enough (e.g. you want "debug" level +logging for certain modules), you can change it in the manifest file. + +Each node exposes a [pprof](https://golang.org/pkg/runtime/pprof/) server. To +find out the local port, run `docker port 6060 | awk -F: '{print +$2}'`. Then you may perform any queries supported by the pprof tool. Julia +Evans has a [great +post](https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/) on this +subject. + +```bash +export PORT=$(docker port full01 6060 | awk -F: '{print $2}') + +go tool pprof http://localhost:$PORT/debug/pprof/goroutine +go tool pprof http://localhost:$PORT/debug/pprof/heap +go tool pprof http://localhost:$PORT/debug/pprof/threadcreate +go tool pprof http://localhost:$PORT/debug/pprof/block +go tool pprof http://localhost:$PORT/debug/pprof/mutex +``` ## Enabling IPv6 -Docker does not enable IPv6 by default. To do so, enter the following in `daemon.json` (or in the Docker for Mac UI under Preferences → Docker Engine): +Docker does not enable IPv6 by default. To do so, enter the following in +`daemon.json` (or in the Docker for Mac UI under Preferences → Docker Engine): ```json { diff --git a/test/e2e/docker/Dockerfile b/test/e2e/docker/Dockerfile index 825aa7f0d..807b9f572 100644 --- a/test/e2e/docker/Dockerfile +++ b/test/e2e/docker/Dockerfile @@ -27,7 +27,7 @@ WORKDIR /tendermint VOLUME /tendermint ENV TMHOME=/tendermint -EXPOSE 26656 26657 26660 +EXPOSE 26656 26657 26660 6060 ENTRYPOINT ["/usr/bin/entrypoint"] CMD ["node"] STOPSIGNAL SIGTERM diff --git a/test/e2e/runner/setup.go b/test/e2e/runner/setup.go index c1a7502db..7354d74da 100644 --- a/test/e2e/runner/setup.go +++ b/test/e2e/runner/setup.go @@ -165,6 +165,7 @@ services: ports: - 26656 - {{ if .ProxyPort }}{{ .ProxyPort }}:{{ end }}26657 + - 6060 volumes: - ./{{ .Name }}:/tendermint networks: @@ -220,6 +221,7 @@ func MakeConfig(node *e2e.Node) (*config.Config, error) { cfg.Moniker = node.Name cfg.ProxyApp = AppAddressTCP cfg.RPC.ListenAddress = "tcp://0.0.0.0:26657" + cfg.RPC.PprofListenAddress = ":6060" cfg.P2P.ExternalAddress = fmt.Sprintf("tcp://%v", node.AddressP2P(false)) cfg.P2P.AddrBookStrict = false cfg.DBBackend = node.Database