Test waits till synchronization is started, then interrupts network connection, wait for a failure event and restore network connection, confirming that after the connection is restored synchronization will proceed.
Network disconnect is introduced by removing default gateway, easily reversible condition.
On my local machine it takes 30 seconds for peers to reconnect after connectivity is restored. As you guess this is not an accident, and there is 30 seconds timeout for dial expiration. This dial expiration is used in p2p.Server to guarantee that peers are not dialed too often.
Additionally I added small script to Makefile to run such tests in docker environment, usage example:
```
make docker-test ARGS="./t/destructive/ -v -network=4"
```
Improve patcher tool:
* fix broken `-p` flag,
* rename it to `-b`,
* add a new `-p` flag that allows specifying the source of the patches, so that it can be used for more than just go-ethereum patches,
* make it work correctly independently of the order that options are specified in the command line.
* Enable gometalinter on tests and fix static analysis issues
* Remove unneeded change
* Fix additional lint errors
* Add nolint directives and error checks
* Add error assertions instead of nolint directives
* Go back to using lint directive for loop.Run goroutine
* Add error check to loop.Run
The main goal of this change is to remove async operations from node manager.
Additionally all of the signals from node manager are moved to status backend.
All of the async operation now will have the following behaviour:
- If node in the correct state exit immediatly without error
- If node not in the correct state exit immediatly with error
- In all other cases spawn a goroutine with wanted operation
- All the progress regarding that operation will be reported
by using signals
- Signals should be handled in once place, which is StatusBackend
There are 2 potentially breaking changes:
- Empty event field will be ommited when Envelope is sent to a client
- All errors will be delivered to a client as an Envelope, previously
some errors (NodeExists, NoRunningNode) were delivered synchronously
Signed-off-by: Dmitry Shulyak <yashulyak@gmail.com>