bug fix. avoid concurrency problem.

This commit is contained in:
Zhen Tang 2013-06-30 12:00:10 +08:00
parent f4f22a47d4
commit 55d2118740
1 changed files with 4 additions and 2 deletions

View File

@ -112,7 +112,8 @@ public class TestController {
testStatusModel.setTestDetailModels(new ArrayList<TestDetailModel>());
int failCount = 0;
int successCount = 0;
List<BehaviorResult> behaviorResults = scenarioContext.getResults();
List<BehaviorResult> behaviorResults = new ArrayList<BehaviorResult>(
scenarioContext.getResults());
long maxDate = 0;
long totalResponseTime = 0;
for (BehaviorResult behaviorResult : behaviorResults) {
@ -162,7 +163,8 @@ public class TestController {
int failCount = 0;
int successCount = 0;
long totalResponseTime = 0;
List<BehaviorResult> behaviorResults = scenarioContext.getResults();
List<BehaviorResult> behaviorResults = new ArrayList<BehaviorResult>(
scenarioContext.getResults());
long maxDate = 0;
for (BehaviorResult behaviorResult : behaviorResults) {
if (behaviorResult.getEndDate().getTime() > maxDate) {