You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "Alisha-Anaum (via GitHub)" <gi...@apache.org> on 2023/07/19 03:35:35 UTC

[GitHub] [incubator-uniffle] Alisha-Anaum opened a new pull request, #1022: Fix the flaky test GrpcServerTest

Alisha-Anaum opened a new pull request, #1022:
URL: https://github.com/apache/incubator-uniffle/pull/1022

   What changes were proposed in this pull request?
   
   I observed a previous fix injected some delay to fix the flaky test, but I believe that fix might be unstable in a CI environment or when run on different machines, given the dependency on some constant wait time. I suggest a new way to fix the test by adding some synchronization for the test execution only. I at first identify the source code location whose slow execution leads to the flaky test failure, where if common/src/main/java/org/apache/uniffle/common/rpc/GrpcServer.java#157 slows the grpcMetrics.incGauge() and grpcMetrics.setGauge(), then the test fails (https://github.com/apache/incubator-uniffle/blob/master/common/src/main/java/org/apache/uniffle/common/rpc/GrpcServer.java#L157 and https://github.com/apache/incubator-uniffle/blob/master/common/src/main/java/org/apache/uniffle/common/rpc/GrpcServer.java#L158). Hence, I introduce one variable in this class [GrpcServer.java](https://github.com/apache/incubator-uniffle/blob/master/common/src/main/java/org/apache/uniffle/co
 mmon/rpc/GrpcServer.java#L158) that is only there to provide some synchronization. Basically, until these two statements are executed, I force the thread that the test runs on to wait before it accesses the value of grpcMetrics.getGaugeMap(). The waiting location is at https://github.com/apache/incubator-uniffle/blob/master/common/src/test/java/org/apache/uniffle/common/rpc/GrpcServerTest.java#L72
   
   
   Why are the changes needed?
   This test is flakily fails. I run this test many times and it makes assertion fails. The failure message is as follows.
   Failure:
   [INFO] Running org.apache.uniffle.common.rpc.GrpcServerTest
   [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.185 s <<< FAILURE! - in org.apache.uniffle.common.rpc.GrpcServerTest
   [ERROR] testGrpcExecutorPool Time elapsed: 0.142 s <<< FAILURE!
   org.opentest4j.AssertionFailedError: expected: <2.0> but was: <0.0>
   at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
   at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
   at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:70)
   at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:65)
   at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:885)
   at org.apache.uniffle.common.rpc.GrpcServerTest.testGrpcExecutorPool(GrpcServerTest.java:76)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:498)
   at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
   at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
   
   [ERROR] Failures:
   [ERROR] GrpcServerTest.testGrpcExecutorPool:76 expected: <2.0> but was: <0.0>
   [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
   
   How was this patch tested?
   I run this test more than 1000 times and the test always passes.


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] Alisha-Anaum closed pull request #1022: Fix the flaky test GrpcServerTest

Posted by "Alisha-Anaum (via GitHub)" <gi...@apache.org>.
Alisha-Anaum closed pull request #1022: Fix the flaky test GrpcServerTest
URL: https://github.com/apache/incubator-uniffle/pull/1022


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #1022: Fix the flaky test GrpcServerTest

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1022:
URL: https://github.com/apache/incubator-uniffle/pull/1022#issuecomment-1641370018

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1022?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#1022](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1022?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (6ec4e97) into [master](https://app.codecov.io/gh/apache/incubator-uniffle/commit/e5e1b304db19a8b8f1422291b28eaacba7270f4f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (e5e1b30) will **increase** coverage by `1.80%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #1022      +/-   ##
   ============================================
   + Coverage     53.67%   55.48%   +1.80%     
   + Complexity     2521     2088     -433     
   ============================================
     Files           382      310      -72     
     Lines         21646    13907    -7739     
     Branches       1795     1255     -540     
   ============================================
   - Hits          11619     7716    -3903     
   + Misses         9323     5765    -3558     
   + Partials        704      426     -278     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1022?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...java/org/apache/uniffle/common/rpc/GrpcServer.java](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1022?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NvbW1vbi9ycGMvR3JwY1NlcnZlci5qYXZh) | `81.25% <100.00%> (+0.48%)` | :arrow_up: |
   
   ... and [77 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-uniffle/pull/1022/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :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=apache)
   


-- 
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@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org