Fix typo and add failure case in test-salt-model pipeline

Change-Id: Ic3dc4e0550fd59f91375d1cb0faa53d7f137ebb6
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index dfc3170..060656c 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -165,7 +165,7 @@
                 triggerTestNodeJob(defaultGitUrl, defaultGitRef, clusterName, testTarget, formulasSource)
             } catch (Exception e) {
               failedNodes << [defaultGitUrl, defaultGitRef, clusterName, testTarget, formulasSource]
-              common.warningMsg("Test of ${retryNode[2]} failed :  ${e}")
+              common.warningMsg("Test of ${clusterName} failed :  ${e}")
             }
           }
           acc++;
@@ -174,8 +174,9 @@
           parallel branches
         }
 
-        def nbRetry = 2
-        for (int i = 0; i < nbRetry && failedNodes; ++i) {
+        def nbRetry = 1
+        def maxNbRetry = infraYMLs.size() > 10 ? infraYMLs.size() / 2 : 10
+        for (int i = 0; i < nbRetry && failedNodes && failedNodes.size() <= maxNbRetry; ++i) {
           branches = [:]
           acc = 0
           retryNodes = failedNodes
@@ -202,6 +203,9 @@
             parallel branches
           }
         }
+        if (failedNodes) {
+          currentBuild.result = "FAILURE"
+        }
       }
     }
   } catch (Throwable e) {