You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "smallzhongfeng (via GitHub)" <gi...@apache.org> on 2023/02/02 12:51:48 UTC

[GitHub] [incubator-uniffle] smallzhongfeng opened a new pull request, #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

smallzhongfeng opened a new pull request, #544:
URL: https://github.com/apache/incubator-uniffle/pull/544

   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://github.com/apache/incubator-uniffle/blob/master/CONTRIBUTING.md
     2. Ensure you have added or run the appropriate tests for your PR
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]XXXX Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   1. The way to write mini hdfs has been removed, which is consistent with `AppBalanceSelectStorageStrategyTest`. 
   2. Close the scheduling thread for writing the hdfs file.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   To resolve #526 
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   No.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Fix ut.


-- 
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] smallzhongfeng commented on pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   Thanks for your review. @kaijchen @jerqi 


-- 
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] smallzhongfeng commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "smallzhongfeng (via GitHub)" <gi...@apache.org>.
smallzhongfeng commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095393267


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   This sleep time can actually be set smaller.



-- 
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] smallzhongfeng commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "smallzhongfeng (via GitHub)" <gi...@apache.org>.
smallzhongfeng commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095401699


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   OK.



-- 
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] kaijchen commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095376293


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);

Review Comment:
   Why do we need to sleep between two `sortPathByRankValue()`?



-- 
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] kaijchen commented on pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   @jerqi @advancedxy @zuston do you want to take a look?


-- 
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 #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   # [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/544?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 [#544](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2baa7e7) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/3ef80ed06c170f59a016c5440ac33ef97d8b9d45?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3ef80ed) will **increase** coverage by `5.61%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #544      +/-   ##
   ============================================
   + Coverage     58.72%   64.33%   +5.61%     
   - Complexity     1652     1654       +2     
   ============================================
     Files           199      186      -13     
     Lines         11214     9108    -2106     
     Branches        996      920      -76     
   ============================================
   - Hits           6585     5860     -725     
   + Misses         4237     2931    -1306     
   + Partials        392      317      -75     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...che/uniffle/server/storage/HdfsStorageManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9zdG9yYWdlL0hkZnNTdG9yYWdlTWFuYWdlci5qYXZh) | `90.90% <0.00%> (-4.33%)` | :arrow_down: |
   | [...a/org/apache/uniffle/coordinator/QuotaManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29vcmRpbmF0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3VuaWZmbGUvY29vcmRpbmF0b3IvUXVvdGFNYW5hZ2VyLmphdmE=) | `85.29% <0.00%> (-4.26%)` | :arrow_down: |
   | [...orage/LowestIOSampleCostSelectStorageStrategy.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29vcmRpbmF0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3VuaWZmbGUvY29vcmRpbmF0b3Ivc3RyYXRlZ3kvc3RvcmFnZS9Mb3dlc3RJT1NhbXBsZUNvc3RTZWxlY3RTdG9yYWdlU3RyYXRlZ3kuamF2YQ==) | `70.90% <0.00%> (-3.64%)` | :arrow_down: |
   | [...he/uniffle/server/storage/MultiStorageManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9zdG9yYWdlL011bHRpU3RvcmFnZU1hbmFnZXIuamF2YQ==) | `60.71% <0.00%> (-3.44%)` | :arrow_down: |
   | [.../java/org/apache/uniffle/server/ShuffleServer.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyLmphdmE=) | `60.95% <0.00%> (-3.43%)` | :arrow_down: |
   | [...storage/handler/impl/DataSkippableReadHandler.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmFnZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdW5pZmZsZS9zdG9yYWdlL2hhbmRsZXIvaW1wbC9EYXRhU2tpcHBhYmxlUmVhZEhhbmRsZXIuamF2YQ==) | `83.78% <0.00%> (-2.71%)` | :arrow_down: |
   | [...ava/org/apache/uniffle/server/ShuffleTaskInfo.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlVGFza0luZm8uamF2YQ==) | `98.07% <0.00%> (-1.93%)` | :arrow_down: |
   | [...rg/apache/uniffle/server/buffer/ShuffleBuffer.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9idWZmZXIvU2h1ZmZsZUJ1ZmZlci5qYXZh) | `93.38% <0.00%> (-1.66%)` | :arrow_down: |
   | [...e/storage/handler/impl/HdfsShuffleReadHandler.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmFnZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvdW5pZmZsZS9zdG9yYWdlL2hhbmRsZXIvaW1wbC9IZGZzU2h1ZmZsZVJlYWRIYW5kbGVyLmphdmE=) | `56.25% <0.00%> (-1.57%)` | :arrow_down: |
   | [.../apache/uniffle/coordinator/ClientConfManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29vcmRpbmF0b3Ivc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3VuaWZmbGUvY29vcmRpbmF0b3IvQ2xpZW50Q29uZk1hbmFnZXIuamF2YQ==) | `91.54% <0.00%> (-1.41%)` | :arrow_down: |
   | ... and [56 more](https://codecov.io/gh/apache/incubator-uniffle/pull/544?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :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@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] smallzhongfeng commented on pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   I think we need to increase this time? @kaijchen WDYT?


-- 
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] kaijchen commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095377206


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   Why do we need to sleep before this line?



-- 
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] kaijchen merged pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen merged PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544


-- 
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] smallzhongfeng commented on pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   > Thanks for fixing this @smallzhongfeng. Please add a `@Timeout()` tag after `@Test`. In case of `cdl.await()` never return.
   
   Good idea, added.


-- 
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] kaijchen commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "kaijchen (via GitHub)" <gi...@apache.org>.
kaijchen commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095393356


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   > Ensure that the `System.currentTimeMillis()` corresponding to `remoteStorage1` is greater than that of `remoteStorage2`, because under the `IO` policy, this time is used to measure which remote path is selected, and the smaller the time, the better it will be selected.
   
   Let's add this comment to the code?



-- 
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] smallzhongfeng commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "smallzhongfeng (via GitHub)" <gi...@apache.org>.
smallzhongfeng commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095401847


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   OK.



-- 
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] smallzhongfeng commented on a diff in pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

Posted by "smallzhongfeng (via GitHub)" <gi...@apache.org>.
smallzhongfeng commented on code in PR #544:
URL: https://github.com/apache/incubator-uniffle/pull/544#discussion_r1095391202


##########
coordinator/src/test/java/org/apache/uniffle/coordinator/strategy/storage/LowestIOSampleCostSelectStorageStrategyTest.java:
##########
@@ -103,19 +83,19 @@ public void selectStorageTest() throws Exception {
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost1).get(), 0.5);
     String storageHost2 = "p2";
     assertEquals(0.0, CoordinatorMetrics.GAUGE_USED_REMOTE_STORAGE.get(storageHost2).get(), 0.5);
+    applicationManager.getSelectStorageStrategy().detectStorage();
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage1).getAppNum().get());
+    assertEquals(0, applicationManager.getRemoteStoragePathRankValue().get(remoteStorage2).getAppNum().get());
 
     // compare with two remote path
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     applicationManager.incRemoteStorageCounter(remoteStorage1);
     String testApp1 = "application_test_" + 1;
     applicationManager.registerApplicationInfo(testApp1, "user");
     applicationManager.refreshAppId(testApp1);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, System.currentTimeMillis());
     Thread.sleep(1000);
-    final long current = System.currentTimeMillis();
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage2, testFile, current);
-    fs.create(path);
-    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, current);
+    selectStorageStrategy.sortPathByRankValue(remoteStorage1, testFile, System.currentTimeMillis());

Review Comment:
   Ensure that the `System.currentTimeMillis()` corresponding to `remoteStorage1` is greater than that of `remoteStorage2`, because under the `IO` policy, this time is used to measure which remote path is selected, and the smaller the time, the better it will be selected.



-- 
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] kaijchen commented on pull request #544: Flaky Test: LowestIOSampleCostSelectStorageStrategyTest#selectStorageTest

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

   Hi @smallzhongfeng, seems `selectStorageMulThreadTest` is timeout occasionally.
   https://github.com/apache/incubator-uniffle/actions/runs/4184426217/jobs/7250404544#step:6:614


-- 
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