ningyougang commented on code in PR #5290:
URL: https://github.com/apache/openwhisk/pull/5290#discussion_r929675790


##########
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/AkkaContainerClient.scala:
##########
@@ -201,6 +201,19 @@ object AkkaContainerClient {
     result
   }
 
+  /** A helper method to post one single request to a connection. Used for 
container tests. */
+  def postForJsArray(host: String, port: Int, endPoint: String, content: 
JsValue, timeout: FiniteDuration)(
+    implicit logging: Logging,
+    as: ActorSystem,
+    ec: ExecutionContext,
+    tid: TransactionId): (Int, Option[JsArray]) = {

Review Comment:
   * `def runForJsArray` is added for test case, the return value is `(Int, 
Option[JsArray])`
   * call chain here is: `def runForJsArray` -> `private def 
syncPostForJsArray` -> `def postForJsArray`
   
   Actually, in order to support test, we can change below method to support 
return `(Int, Option[JsValue])` also
   
![image](https://user-images.githubusercontent.com/11749867/180959848-4d0317a2-264a-4ba5-806b-cf179b5e4baa.png)
   But if we change the run directly, there would be a lot of changes in 
openwhisk repo and all runtime codes should change as well.
   
   So here, i added another extra method to test return array
   
![image](https://user-images.githubusercontent.com/11749867/180960350-2b90fa00-39af-438e-97d7-d63bb86390dd.png)
   This is just for `impact the original code as little as possible`: 
https://github.com/apache/openwhisk/pull/5290#discussion_r926350523



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to