private void sync(RpcClient client, RpcServer server, int timeout) {
        RequestBody b1 = new RequestBody(1, RequestBody.DEFAULT_SYNC_STR);
        Object obj = null;
        try {
            if (null == server) {
                obj = client.invokeSync(addr, b1, timeout);
            } else {
                Connection conn = client.getConnection(addr, timeout);
                Assert.assertNotNull(serverConnectProcessor.getConnection());
                Connection serverConn = serverConnectProcessor.getConnection();
                obj = server.invokeSync(serverConn, b1, timeout);
            }
            Assert.fail("Should not reach here!");
        } catch (InvokeTimeoutException e) {
            Assert.assertNull(obj);
        } catch (RemotingException e) {
            logger.error("Other RemotingException but RpcServerTimeoutException occurred in sync",
                e);
            Assert.fail("Should not reach here!");
        } catch (InterruptedException e) {
            logger.error("InterruptedException in sync", e);
            Assert.fail("Should not reach here!");
        }
    }
the second request will timeout in work queue
src/test/java/com/alipay/remoting/rpc/timeout/ServerTimeoutTest.java