fix: data race

This commit is contained in:
xucong053
2022-07-25 21:23:06 +08:00
committed by 徐聪
parent b654f32cc3
commit d67764e49c
4 changed files with 8 additions and 7 deletions
+5
View File
@@ -289,6 +289,9 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
// reset start time only once
once := sync.Once{}
// update session variables mutex
mutex := sync.Mutex{}
return &boomer.Task{
Name: testcase.Config.Name,
Weight: testcase.Config.Weight,
@@ -299,9 +302,11 @@ func (b *HRPBoomer) convertBoomerTask(testcase *TestCase, rendezvousList []*Rend
// init session runner
sessionRunner := caseRunner.newSession()
mutex.Lock()
if parametersIterator.HasNext() {
sessionRunner.updateSessionVariables(parametersIterator.Next())
}
mutex.Unlock()
startTime := time.Now()
for _, step := range testcase.TestSteps {