ruediger-maass commented on a change in pull request #4299: Avoid that actions
do not stop after action timeout when logging heavily
URL:
https://github.com/apache/incubator-openwhisk/pull/4299#discussion_r260731042
##########
File path:
tests/src/test/scala/org/apache/openwhisk/core/limits/ActionLimitsTests.scala
##########
@@ -463,4 +463,34 @@ class ActionLimitsTests extends TestHelpers with
WskTestHelpers with WskActorSys
_.response.result.get.fields("error") shouldBe
Messages.memoryExhausted.toJson
}
}
+
+ /**
+ * Test that a heavy logging action is interrupted within its timeout limits.
+ */
+ it should "interrupt the heavy logging action within its time limits" in
withAssetCleaner(wskprops) {
+ (wp, assetHelper) =>
+ val name = "NodeJsTestLoggingActionCausingTimeout-" +
System.currentTimeMillis()
+ print(s"\n create action ${name} using api host: ${wskprops.apihost}..")
+ assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {
(action, _) =>
+ action.create(
+ name,
+ Some(TestUtils.getTestActionFilename("loggingTimeout.js")),
+ timeout = Some(allowedActionDuration),
+ kind = Some("nodejs:8"))
+ }
+ val durationMillis = allowedActionDuration + 3.minutes
+ val checkDurationMillis = allowedActionDuration + 1.minutes
+ val run =
+ wsk.action.invoke(name, Map("durationMillis" ->
durationMillis.toMillis.toJson, "delayMillis" -> 100.toJson))
+ withActivation(wsk.activation, run) { result =>
+ withClue("Activation result not as expected:") {
+ result.response.status shouldBe
ActivationResponse.messageForCode(ActivationResponse.DeveloperError)
+ result.response.result.get.toString should include("""exceeded its
time limits""")
Review comment:
done, applied your proposal to the code
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services