diff --git a/shared/utils.js b/shared/utils.js index 5e3b22d..a4f3c6b 100644 --- a/shared/utils.js +++ b/shared/utils.js @@ -27,24 +27,6 @@ export function waitForResourceCount( } } -export function waitForLagStabilization( - namespace, - threshold, - maxTries, - interval -) { - let lag = 0; - let tries = 0; - do { - tries++; - sleep(interval); - lag = prometheus.getLag(namespace); - } while (lag > threshold && tries < maxTries); - if (lag > threshold) { - throw Error(`lag not stabilized after ${tries * interval} seconds.`); - } -} - export function generatePrefix(testCase) { return crypto.md5(testCase, "hex"); } diff --git a/tests/test-scaledobject.js b/tests/test-scaledobject.js index 544f41c..2d7c017 100644 --- a/tests/test-scaledobject.js +++ b/tests/test-scaledobject.js @@ -59,8 +59,9 @@ export function setup() { 20, 15 ); - // Wait for metrics stabilization before starting the tests - utils.waitForLagStabilization(workload.getNamespaceName(), 100, 6, 10); + + // Wait a minute to stabilizate prometheus metrics before the test + sleep(60); } export default function () {