You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2022/11/01 07:41:00 UTC

[GitHub] [openwhisk] style95 opened a new pull request, #5346: Make the test stable

style95 opened a new pull request, #5346:
URL: https://github.com/apache/openwhisk/pull/5346

   
   
   ## Description
   This is to make the test stable.
   
   ## Related issue and scope
   <!--- Please include a link to a related issue if there is one. -->
   - [ ] I opened an issue to propose and discuss this change (#????)
   
   ## My changes affect the following components
   <!--- Select below all system components are affected by your change. -->
   <!--- Enter an `x` in all applicable boxes. -->
   - [ ] API
   - [ ] Controller
   - [ ] Message Bus (e.g., Kafka)
   - [ ] Loadbalancer
   - [ ] Scheduler
   - [ ] Invoker
   - [ ] Intrinsic actions (e.g., sequences, conductors)
   - [ ] Data stores (e.g., CouchDB)
   - [x] Tests
   - [ ] Deployment
   - [ ] CLI
   - [ ] General tooling
   - [ ] Documentation
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Use `x` in all the boxes that apply: -->
   - [ ] Bug fix (generally a non-breaking change which closes an issue).
   - [x] Enhancement or new feature (adds new functionality).
   - [ ] Breaking change (a bug fix or enhancement which changes existing behavior).
   
   ## Checklist:
   <!--- Please review the points below which help you make sure you've covered all aspects of the change you're making. -->
   
   - [x] I signed an [Apache CLA](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md).
   - [x] I reviewed the [style guides](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md#coding-standards) and followed the recommendations (Travis CI will check :).
   - [ ] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] I updated the documentation where necessary.
   
   


-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] codecov-commenter commented on pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#issuecomment-1298286481

   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/5346?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5346](https://codecov.io/gh/apache/openwhisk/pull/5346?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c6e4532) into [master](https://codecov.io/gh/apache/openwhisk/commit/07c920249d0a0db5fe3bc603add73e410f40dddd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (07c9202) will **decrease** coverage by `0.16%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #5346      +/-   ##
   ==========================================
   - Coverage   38.96%   38.79%   -0.17%     
   ==========================================
     Files         240      240              
     Lines       14378    14383       +5     
     Branches      614      614              
   ==========================================
   - Hits         5602     5580      -22     
   - Misses       8776     8803      +27     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/5346?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../core/containerpool/v2/ActivationClientProxy.scala](https://codecov.io/gh/apache/openwhisk/pull/5346/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC92Mi9BY3RpdmF0aW9uQ2xpZW50UHJveHkuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...ntainerpool/v2/FunctionPullingContainerProxy.scala](https://codecov.io/gh/apache/openwhisk/pull/5346/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC92Mi9GdW5jdGlvblB1bGxpbmdDb250YWluZXJQcm94eS5zY2FsYQ==) | `0.00% <0.00%> (ø)` | |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/5346/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `53.90% <0.00%> (-17.97%)` | :arrow_down: |
   | [.../org/apache/openwhisk/common/NestedSemaphore.scala](https://codecov.io/gh/apache/openwhisk/pull/5346/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvbW1vbi9OZXN0ZWRTZW1hcGhvcmUuc2NhbGE=) | `81.81% <0.00%> (+3.03%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010193279


##########
tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala:
##########
@@ -1575,6 +1575,9 @@ class FunctionPullingContainerProxyTests
 
     machine ! Initialize(invocationNamespace.asString, fqn, action, schedulerHost, rpcPort, messageTransId)
     probe.expectMsg(Transition(machine, Uninitialized, CreatingClient))
+    awaitAssert {
+      machine.stateData shouldBe a[ContainerCreatedData]

Review Comment:
   Let me explain the details.
   
   ```scala
       case Event(ClientCreationCompleted(proxy), _: NonexistentData) =>
         self ! ClientCreationCompleted(proxy.orElse(Some(sender())))
         stay()
   ```
   https://github.com/apache/openwhisk/blob/master/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala#L342
   
   According to this logic, if the proxy receives `ClientCreationCompleted` before the data becomes the `ContainerCreatedData` that comes from [here](https://github.com/apache/openwhisk/blob/master/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala#L322), it repeatedly send the message to itself.
   And it creates an akka message cycle.
   
   Generally, it takes some time to create and initialize the activation client proxy.
   It takes more than the time for a container proxy to receive the `ContainerCreatedData`.
   So I believe there was no issue with this.
   
   But in the test code, there is no client proxy initialization and it sent `ClientCreationCompleted` as soon as the proxy status changes. And it made a cycle according to the timing.
   
   
   
   



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010172255


##########
tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala:
##########
@@ -1575,6 +1575,9 @@ class FunctionPullingContainerProxyTests
 
     machine ! Initialize(invocationNamespace.asString, fqn, action, schedulerHost, rpcPort, messageTransId)
     probe.expectMsg(Transition(machine, Uninitialized, CreatingClient))
+    awaitAssert {
+      machine.stateData shouldBe a[ContainerCreatedData]

Review Comment:
   When `ClientCreationCompleted` is sent to the proxy before the data is updated, it causes a kind of cycle and the test keeps running.
   https://github.com/apache/openwhisk/blob/master/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala#L342



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 merged pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 merged PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346


-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010194188


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala:
##########
@@ -339,7 +339,11 @@ class FunctionPullingContainerProxy(
 
     // wait for container creation when cold start
     case Event(ClientCreationCompleted(proxy), _: NonexistentData) =>
-      self ! ClientCreationCompleted(proxy.orElse(Some(sender())))
+      akka.pattern.after(3.milliseconds, actorSystem.scheduler) {

Review Comment:
   Even if it generally does not happen in production, it would be great to add a small delay to avoid the cycle as a last resort.
   



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 commented on pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#issuecomment-1298157550

   LGTM thanks for fixing this, seems like this is why I've been having trouble with the scheduler tests.


-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010174107


##########
tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/FunctionPullingContainerProxyTests.scala:
##########
@@ -1575,6 +1575,9 @@ class FunctionPullingContainerProxyTests
 
     machine ! Initialize(invocationNamespace.asString, fqn, action, schedulerHost, rpcPort, messageTransId)
     probe.expectMsg(Transition(machine, Uninitialized, CreatingClient))
+    awaitAssert {
+      machine.stateData shouldBe a[ContainerCreatedData]

Review Comment:
   Was this test instability introduced recently? I know this is just a test, but I'm wondering if there could be an issue with this https://github.com/apache/openwhisk/pull/5333 since I'm seeing weird orphaned non-existent containers in etcd



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010194188


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala:
##########
@@ -339,7 +339,11 @@ class FunctionPullingContainerProxy(
 
     // wait for container creation when cold start
     case Event(ClientCreationCompleted(proxy), _: NonexistentData) =>
-      self ! ClientCreationCompleted(proxy.orElse(Some(sender())))
+      akka.pattern.after(3.milliseconds, actorSystem.scheduler) {

Review Comment:
   Even if it generally does not happen in production, it would be great to add a small delay to avoid the cycle.
   



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5346: Make the test stable

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5346:
URL: https://github.com/apache/openwhisk/pull/5346#discussion_r1010193734


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/ActivationClientProxy.scala:
##########
@@ -124,7 +124,9 @@ class ActivationClientProxy(
       stay()
 
     case Event(e: RescheduleActivation, client: Client) =>
-      logging.info(this, s"[${containerId.asString}] got a reschedule message ${e.msg.activationId} for action: ${e.msg.action}")
+      logging.info(

Review Comment:
   I have no idea how it passed the scalaFmt in the previous PR.
   



-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org