dubeejw commented on a change in pull request #2491: Limit length of HTTP body 
displayed when debugging.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2491#discussion_r130417288
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
 ##########
 @@ -60,6 +60,31 @@ class ActionLimitsTests extends TestHelpers with 
WskTestHelpers {
 
     behavior of "Action limits"
 
+    it should "limit the length of HTTP Req/Resp Body for --verbose to 1000 
bytes" in withAssetCleaner(wskprops) {
+        (wp, assetHelper) =>
+            val auth: Seq[String] = Seq("--auth", wskprops.authKey)
+            val name = "largeFileAction"
+            val msg = "will be truncated"
+            val endMsg = "END"    //  Message that should be truncated
+            val largeTestFile = new 
File(s"$testActionsDir${File.separator}$name.js")    // Creates a file to see 
if "code" field is limited
+
+            largeTestFile.createNewFile()
+            val pw = new PrintWriter(largeTestFile)
+            pw.write("a" * 1000)
+            pw.write(endMsg)
+            pw.close
+
+            assetHelper.withCleaner(wsk.action, name) {
+                (action, _) => wsk.action.create(name, 
Some(largeTestFile.getAbsolutePath))
 
 Review comment:
   Did you try using the a large parameters argument instead of creating the 
big file for every run?
 
----------------------------------------------------------------
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

Reply via email to