use constant time comparison (#3452)

This commit is contained in:
fatedier
2023-05-29 00:27:27 +08:00
committed by GitHub
parent 756dd1ad5e
commit 4915852b9c
11 changed files with 45 additions and 35 deletions

View File

@@ -66,8 +66,8 @@ func NewDefaultFramework() *Framework {
options := Options{
TotalParallelNode: suiteConfig.ParallelTotal,
CurrentNodeIndex: suiteConfig.ParallelProcess,
FromPortIndex: 20000,
ToPortIndex: 50000,
FromPortIndex: 10000,
ToPortIndex: 60000,
}
return NewFramework(options)
}
@@ -118,14 +118,14 @@ func (f *Framework) AfterEach() {
// stop processor
for _, p := range f.serverProcesses {
_ = p.Stop()
if TestContext.Debug {
if TestContext.Debug || ginkgo.CurrentSpecReport().Failed() {
fmt.Println(p.ErrorOutput())
fmt.Println(p.StdOutput())
}
}
for _, p := range f.clientProcesses {
_ = p.Stop()
if TestContext.Debug {
if TestContext.Debug || ginkgo.CurrentSpecReport().Failed() {
fmt.Println(p.ErrorOutput())
fmt.Println(p.StdOutput())
}

View File

@@ -38,7 +38,7 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
err = p.Start()
ExpectNoError(err)
}
time.Sleep(2 * time.Second)
time.Sleep(1 * time.Second)
currentClientProcesses := make([]*process.Process, 0, len(clientTemplates))
for i := range clientTemplates {
@@ -56,7 +56,7 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
ExpectNoError(err)
time.Sleep(500 * time.Millisecond)
}
time.Sleep(5 * time.Second)
time.Sleep(2 * time.Second)
return currentServerProcesses, currentClientProcesses
}