@@ -38,33 +38,35 @@ public final void update(final List<Test> testList) {
3838 if (testList == null || testList .isEmpty ())
3939 return ;
4040
41- update (testList , parent , parentPercentage );
42-
43- // level 1, for BDD, this would also include Scenario and excludes
44- // ScenarioOutline
45- List <Test > children = testList .stream ()
46- .flatMap (x -> x .getChildren ().stream ())
47- .filter (x -> x .getBddType () != ScenarioOutline .class )
48- .collect (Collectors .toList ());
49- List <Test > scenarios = testList .stream ()
50- .flatMap (x -> x .getChildren ().stream ())
51- .flatMap (x -> x .getChildren ().stream ())
52- .filter (x -> x .getBddType () == Scenario .class )
53- .collect (Collectors .toList ());
54- children .addAll (scenarios );
55- update (children , child , childPercentage );
56-
57- // level 2, for BDD, this only includes Steps
58- List <Test > grandChildren = children .stream ()
59- .flatMap (x -> x .getChildren ().stream ())
60- .filter (x -> x .getBddType () != Scenario .class )
61- .collect (Collectors .toList ());
62- update (grandChildren , grandchild , grandchildPercentage );
63-
64- List <Log > logs = testList .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ());
65- logs .addAll (children .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ()));
66- logs .addAll (grandChildren .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ()));
67- update (logs , log , logPercentage );
41+ synchronized (testList ) {
42+ update (testList , parent , parentPercentage );
43+
44+ // level 1, for BDD, this would also include Scenario and excludes
45+ // ScenarioOutline
46+ List <Test > children = testList .stream ()
47+ .flatMap (x -> x .getChildren ().stream ())
48+ .filter (x -> x .getBddType () != ScenarioOutline .class )
49+ .collect (Collectors .toList ());
50+ List <Test > scenarios = testList .stream ()
51+ .flatMap (x -> x .getChildren ().stream ())
52+ .flatMap (x -> x .getChildren ().stream ())
53+ .filter (x -> x .getBddType () == Scenario .class )
54+ .collect (Collectors .toList ());
55+ children .addAll (scenarios );
56+ update (children , child , childPercentage );
57+
58+ // level 2, for BDD, this only includes Steps
59+ List <Test > grandChildren = children .stream ()
60+ .flatMap (x -> x .getChildren ().stream ())
61+ .filter (x -> x .getBddType () != Scenario .class )
62+ .collect (Collectors .toList ());
63+ update (grandChildren , grandchild , grandchildPercentage );
64+
65+ List <Log > logs = testList .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ());
66+ logs .addAll (children .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ()));
67+ logs .addAll (grandChildren .stream ().flatMap (x -> x .getLogs ().stream ()).collect (Collectors .toList ()));
68+ update (logs , log , logPercentage );
69+ }
6870 }
6971
7072 private final void update (final List <? extends RunResult > list , final Map <Status , Long > countMap ,
0 commit comments