mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +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"
|
||||
@@ -57,7 +58,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()
|
||||
@@ -68,10 +69,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)
|
||||
|
||||
@@ -124,7 +125,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)
|
||||
|
||||
Reference in New Issue
Block a user