Set batch size by default to 2/3 of available worker_threads

If no batch size specified in job parameters set it to 2/3 of available
worker_threads for Salt Master.

Related-Prod: PROD-34417
Change-Id: Ie2dcbcc070214f032c5e31d82f2ddcdea73cbcd4
diff --git a/upgrade-mcp-release.groovy b/upgrade-mcp-release.groovy
index 9e65fca..877a4bc 100644
--- a/upgrade-mcp-release.groovy
+++ b/upgrade-mcp-release.groovy
@@ -429,7 +429,11 @@
                 error('Pillar data is broken for Salt master node! Please check it manually and re-run pipeline.')
             }
             if (!batchSize) {
-                batchSize = getWorkerThreads(venvPepper)
+                // if no batch size provided get current worker threads and set batch size to 2/3 of it to avoid
+                // 'SaltReqTimeoutError: Message timed out' issue on Salt targets for large amount of nodes
+                // do not use toDouble/Double as it requires additional approved method
+                def workerThreads = getWorkerThreads(venvPepper).toInteger()
+                batch_size = (workerThreads * 2 / 3).toString().tokenize('.')[0]
             }
             def computeMinions = salt.getMinions(venvPepper, 'I@nova:compute')