mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-06-30 02:55:23 +00:00
update commander test
This commit is contained in:
parent
4bd1ef0650
commit
7bc45eb8aa
|
@ -502,6 +502,7 @@ func TestCommanderStats(t *testing.T) {
|
||||||
Port: int(clientPort),
|
Port: int(clientPort),
|
||||||
})
|
})
|
||||||
assert(err, IsNil)
|
assert(err, IsNil)
|
||||||
|
defer conn.Close() // nolint: errcheck
|
||||||
|
|
||||||
payload := make([]byte, 10240*1024)
|
payload := make([]byte, 10240*1024)
|
||||||
rand.Read(payload)
|
rand.Read(payload)
|
||||||
|
@ -511,8 +512,9 @@ func TestCommanderStats(t *testing.T) {
|
||||||
assert(nBytes, Equals, len(payload))
|
assert(nBytes, Equals, len(payload))
|
||||||
|
|
||||||
response := readFrom(conn, time.Second*20, 10240*1024)
|
response := readFrom(conn, time.Second*20, 10240*1024)
|
||||||
assert(response, Equals, xor([]byte(payload)))
|
if err := compare.BytesEqualWithDetail(response, xor([]byte(payload))); err != nil {
|
||||||
assert(conn.Close(), IsNil)
|
t.Fatal("failed to read response: ", err)
|
||||||
|
}
|
||||||
|
|
||||||
cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock())
|
cmdConn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", cmdPort), grpc.WithInsecure(), grpc.WithBlock())
|
||||||
assert(err, IsNil)
|
assert(err, IsNil)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user