diff --git a/Makefile b/Makefile index dfb0dc3a..2271abeb 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,9 @@ test_race: test_integrations: @bash ./test/test.sh +release: + @go test -tags release $(PACKAGES) + test100: @for i in {1..100}; do make test; done diff --git a/rpc/lib/client/integration_test.go b/rpc/lib/client/integration_test.go new file mode 100644 index 00000000..d3d99337 --- /dev/null +++ b/rpc/lib/client/integration_test.go @@ -0,0 +1,66 @@ +// +build release + +// The code in here is comprehensive as an integration +// test and is long, hence is only run before releases. + +package rpcclient + +import ( + "bytes" + "errors" + "net" + "regexp" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/tendermint/tmlibs/log" +) + +func TestWSClientReconnectWithJitter(t *testing.T) { + n := 8 + maxReconnectAttempts := 3 + // Max wait time is ceil(1+0.999) + ceil(2+0.999) + ceil(4+0.999) + ceil(...) = 2 + 3 + 5 = 10s + ... + maxSleepTime := time.Second * time.Duration(((1<