mirror of
https://github.com/fatedier/frp.git
synced 2025-08-01 19:49:03 +00:00
added a 30s timeout for frpc subcommands to avoid long delays (#4359)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package basic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -54,7 +55,7 @@ var _ = ginkgo.Describe("[Feature: ClientManage]", func() {
|
||||
framework.NewRequestExpect(f).Port(p3Port).Ensure()
|
||||
|
||||
client := f.APIClientForFrpc(adminPort)
|
||||
conf, err := client.GetConfig()
|
||||
conf, err := client.GetConfig(context.Background())
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
newP2Port := f.AllocPort()
|
||||
@@ -65,10 +66,10 @@ var _ = ginkgo.Describe("[Feature: ClientManage]", func() {
|
||||
newClientConf = newClientConf[:p3Index]
|
||||
}
|
||||
|
||||
err = client.UpdateConfig(newClientConf)
|
||||
err = client.UpdateConfig(context.Background(), newClientConf)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
err = client.Reload(true)
|
||||
err = client.Reload(context.Background(), true)
|
||||
framework.ExpectNoError(err)
|
||||
time.Sleep(time.Second)
|
||||
|
||||
@@ -120,7 +121,7 @@ var _ = ginkgo.Describe("[Feature: ClientManage]", func() {
|
||||
framework.NewRequestExpect(f).Port(testPort).Ensure()
|
||||
|
||||
client := f.APIClientForFrpc(adminPort)
|
||||
err := client.Stop()
|
||||
err := client.Stop(context.Background())
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
time.Sleep(3 * time.Second)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package basic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
@@ -101,7 +102,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
||||
client := f.APIClientForFrpc(adminPort)
|
||||
|
||||
// tcp random port
|
||||
status, err := client.GetProxyStatus("tcp")
|
||||
status, err := client.GetProxyStatus(context.Background(), "tcp")
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
_, portStr, err := net.SplitHostPort(status.RemoteAddr)
|
||||
@@ -112,7 +113,7 @@ var _ = ginkgo.Describe("[Feature: Server Manager]", func() {
|
||||
framework.NewRequestExpect(f).Port(port).Ensure()
|
||||
|
||||
// udp random port
|
||||
status, err = client.GetProxyStatus("udp")
|
||||
status, err = client.GetProxyStatus(context.Background(), "udp")
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
_, portStr, err = net.SplitHostPort(status.RemoteAddr)
|
||||
|
Reference in New Issue
Block a user