@@ -229,68 +229,6 @@ class ThrottleTests
229229 settleThrottles(alreadyWaited)
230230 }
231231 }
232-
233- it should " throttle 'concurrent' activations of one action" in withAssetCleaner(wskprops) { (wp, assetHelper) =>
234- val name = " checkConcurrentActionThrottle"
235- assetHelper.withCleaner(wsk.action, name) {
236- val timeoutAction = Some (TestUtils .getTestActionFilename(" sleep.js" ))
237- (action, _) =>
238- action.create(name, timeoutAction)
239- }
240-
241- // The sleep is necessary as the load balancer currently has a latency before recognizing concurrency.
242- val sleep = 15 .seconds
243- // Adding a bit of overcommit since some loadbalancers rely on some overcommit. This won't hurt those who don't
244- // since all activations are taken into account to check for throttled invokes below.
245- val slowInvokes = (maximumConcurrentInvokes * 1.2 ).toInt
246- val fastInvokes = 4
247- val fastInvokeDuration = 4 .seconds
248- val slowInvokeDuration = sleep + fastInvokeDuration
249-
250- // These invokes will stay active long enough that all are issued and load balancer has recognized concurrency.
251- val startSlowInvokes = Instant .now
252- val slowResults = untilThrottled(slowInvokes) { () =>
253- wsk.action.invoke(
254- name,
255- Map (" sleepTimeInMs" -> slowInvokeDuration.toMillis.toJson),
256- expectedExitCode = DONTCARE_EXIT )
257- }
258- val afterSlowInvokes = Instant .now
259- val slowIssueDuration = durationBetween(startSlowInvokes, afterSlowInvokes)
260- println(
261- s " $slowInvokes slow invokes (dur = ${slowInvokeDuration.toSeconds} sec) took ${slowIssueDuration.toSeconds} seconds to issue " )
262-
263- // Sleep to let the background thread get the newest values (refreshes every 2 seconds)
264- println(s " Sleeping for ${sleep.toSeconds} sec " )
265- Thread .sleep(sleep.toMillis)
266-
267- // These fast invokes will trigger the concurrency-based throttling.
268- val startFastInvokes = Instant .now
269- val fastResults = untilThrottled(fastInvokes) { () =>
270- wsk.action.invoke(
271- name,
272- Map (" sleepTimeInMs" -> fastInvokeDuration.toMillis.toJson),
273- expectedExitCode = DONTCARE_EXIT )
274- }
275- val afterFastInvokes = Instant .now
276- val fastIssueDuration = durationBetween(afterFastInvokes, startFastInvokes)
277- println(
278- s " $fastInvokes fast invokes (dur = ${fastInvokeDuration.toSeconds} sec) took ${fastIssueDuration.toSeconds} seconds to issue " )
279-
280- val combinedResults = slowResults ++ fastResults
281- try {
282- val throttledCount = throttledActivations(combinedResults, tooManyConcurrentRequests(0 , 0 ))
283- throttledCount should be > 0
284- } finally {
285- val alreadyWaited = durationBetween(afterSlowInvokes, Instant .now)
286- settleThrottles(alreadyWaited)
287- println(" clearing activations" )
288- }
289- // wait for the activations last, giving the activations time to complete and
290- // may avoid unnecessarily polling; if these fail, the throttle may not be settled
291- println(" waiting for activations to complete" )
292- waitForActivations(combinedResults)
293- }
294232}
295233
296234@ RunWith (classOf [JUnitRunner ])
@@ -458,19 +396,6 @@ class NamespaceSpecificThrottleTests
458396 }, 2 , Some (1 .second))
459397 }
460398
461- it should " respect overridden concurrent throttle of 0" in withAssetCleaner(zeroConcProps) { (wp, assetHelper) =>
462- implicit val props = wp
463- val actionName = " zeroConcurrentAction"
464-
465- assetHelper.withCleaner(wsk.action, actionName) { (action, _) =>
466- action.create(actionName, defaultAction)
467- }
468-
469- wsk.action.invoke(actionName, expectedExitCode = TooManyRequests .intValue).stderr should {
470- include(prefix(tooManyConcurrentRequests(0 , 0 ))) and include(" allowed: 0" )
471- }
472- }
473-
474399 it should " not store an activation if disabled for this namespace" in withAssetCleaner(activationDisabled) {
475400 (wp, assetHelper) =>
476401 implicit val props = wp
0 commit comments