This test is to verify the client is reconnecting the server with correct backoffs as specified in the spec. The test server has a port (control_port) running a rpc service for controlling the server and another port (retry_port) to close any incoming tcp connections. The test has the following flow:
Client and server use test.proto. Each language should implement its own client. The C++ server is shared among languages.
Clients should accept these arguments:
The client must connect to the control port without TLS. The client must connect to the retry port with TLS. The client should either assert on the server returned backoff status or check the returned backoffs on its own.
Procedure of client:
A C++ server can be used for the test. Other languages do NOT need to implement a server. To minimize the network delay, the server binary should run on the same machine or on a nearby machine (in terms of network distance) with the client binary.
A server implements the ReconnectService to its state. It also opens a tcp server on the retry_port, which just shuts down all incoming tcp connections to simulate connection failures. The server will keep a record of all the reconnection timestamps and return the connection backoffs in the response in milliseconds. The server also checks the backoffs to see whether they conform the spec and returns whether the client passes the test.
If the server receives a Start call when another client is being tested, it finishes the call when the other client is done. If some other host connects to the server retry_port when a client is being tested, the server will log an error but likely would think the client fails the test.
The server accepts these arguments: