Remove throttle tightening.
diff --git a/tests/src/limits/ThrottleTests.scala b/tests/src/limits/ThrottleTests.scala
index fe6aabf..81c9b61 100644
--- a/tests/src/limits/ThrottleTests.scala
+++ b/tests/src/limits/ThrottleTests.scala
@@ -99,7 +99,6 @@
* @param results the sequence of results from invocations or firings
*/
def waitForActivations(results: ParSeq[RunResult]) = results.foreach { result =>
- println("waiting for activations to complete")
if (result.exitCode == SUCCESS_EXIT) {
withActivation(wsk.activation, result, totalWait = 5.minutes)(identity)
}
@@ -135,6 +134,9 @@
val results = List.fill(count)(Future {
if (!p.isCompleted) {
val rr = run()
+ if (rr.exitCode != SUCCESS_EXIT) {
+ println(s"exitCode = ${rr.exitCode} stderr = ${rr.stderr.trim}")
+ }
if (rr.exitCode == THROTTLED) {
p.trySuccess(())
}
@@ -168,9 +170,10 @@
(action, _) => action.create(name, defaultAction)
}
- // Two things to be careful of:
+ // Three things to be careful of:
// 1) We do not know the minute boundary so we perform twice max so that it will trigger no matter where they fall
// 2) We cannot issue too quickly or else the concurrency throttle will be triggered
+ // 3) In the worst case, we do about almost the limit in the first min and just exceed the limit in the second min.
val totalInvokes = 2 * maximumInvokesPerMinute
val numGroups = (totalInvokes / maximumConcurrentInvokes) + 1
val invokesPerGroup = (totalInvokes / numGroups) + 1
@@ -186,11 +189,11 @@
try {
val throttledCount = throttledActivations(results, tooManyRequests)
throttledCount should be > 0
- throttledCount should be <= (results.length - maximumInvokesPerMinute)
} finally {
- waitForActivations(results.par)
val alreadyWaited = durationBetween(afterInvokes, Instant.now)
settleThrottles(alreadyWaited)
+ println("clearing activations")
+ Try { waitForActivations(results.par) }
}
}
@@ -210,7 +213,6 @@
try {
val throttledCount = throttledActivations(results, tooManyRequests)
throttledCount should be > 0
- throttledCount should be <= (results.length - maximumFiringsPerMinute)
} finally {
// no need to wait for activations of triggers since they consume no resources
// (because there is no rule attached in this test)
@@ -261,9 +263,10 @@
val throttledCount = throttledActivations(combinedResults, tooManyConcurrentRequests)
throttledCount should be > 0
} finally {
- waitForActivations(combinedResults.par)
val alreadyWaited = durationBetween(afterSlowInvokes, Instant.now)
settleThrottles(alreadyWaited)
+ println("clearing activations")
+ Try { waitForActivations(combinedResults.par) }
}
}
}