You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cb...@apache.org on 2017/06/26 07:48:28 UTC

[incubator-openwhisk] branch master updated: Action limit test for log truncation procudes less log entries

This is an automated email from the ASF dual-hosted git repository.

cbickel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 54203c7  Action limit test for log truncation procudes less log entries
54203c7 is described below

commit 54203c71369c8c4377fb3b12113fecf4870d0f6e
Author: Sven Lange-Last <sv...@de.ibm.com>
AuthorDate: Fri Jun 23 13:42:05 2017 +0200

    Action limit test for log truncation procudes less log entries
    
    The test now uses the minimum supported log limit (1M) and creates 10% more log output as the limit.
    In the past, the test had a limit of 2M and produced 3M logs.
    
    We frequently saw this test failing in mainOpenwhisk in the past few days because it took too
    long to PUT the activation record to Cloudant, i.e. more than 60 sec. We suspect that
    concurrent load tests in YS0 may have caused the long Cloudant response times because the
    Cloudant DB cluster is shared. But we don`t have enough diagnostic data to prove this assumption.
    
    At the same time, making the log portion in the activation record smaller with this change
    should also make the Cloudant request faster. This change does only affect limits and sizes but
    does not change the test's design.
---
 tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
index ee43dbe..a125105 100644
--- a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
+++ b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
@@ -99,20 +99,22 @@ class ActionLimitsTests extends TestHelpers with WskTestHelpers {
 
     it should "succeed but truncate logs, if log size exceeds its limit" in withAssetCleaner(wskprops) {
         (wp, assetHelper) =>
-            val allowedSize = 2 megabytes
+            val bytesPerLine = 16
+            val allowedSize = 1 megabytes
             val name = "TestActionCausingExceededLogs"
             assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {
                 val actionName = TestUtils.getTestActionFilename("dosLogs.js")
                 (action, _) => action.create(name, Some(actionName), logsize = Some(allowedSize))
             }
 
-            val attemptedSize = allowedSize + 1.megabytes
+            // Add 10% to allowed size to exceed limit
+            val attemptedSize = (allowedSize.toBytes * 1.1).toLong.bytes
 
             val run = wsk.action.invoke(name, Map("payload" -> attemptedSize.toBytes.toJson))
             withActivation(wsk.activation, run) { response =>
                 val lines = response.logs.get
                 lines.last shouldBe Messages.truncateLogs(allowedSize)
-                (lines.length - 1) shouldBe (allowedSize.toBytes / 16)
+                (lines.length - 1) shouldBe (allowedSize.toBytes / bytesPerLine)
                 // dropping 39 characters (timestamp + stream name)
                 // then reform total string adding back newlines
                 val actual = lines.dropRight(1).map(_.drop(39)).mkString("", "\n", "\n").sizeInBytes.toBytes

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].