You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "asalamon74 (via GitHub)" <gi...@apache.org> on 2025/03/24 16:09:27 UTC
[PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
asalamon74 opened a new pull request, #2419:
URL: https://github.com/apache/uniffle/pull/2419
…aProviderTest
# NOTICE: Please remove all these generated template comments before request review(include this line)
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#123] feat(server,coordinator): support xxx"
- "[#123] feat(common): support xxx"
- "[MINOR] improvement(script): fix style"
- "[MINOR] improvement(ci): add some examples and notice"
- "[#233] fix: check null before access result in xxx"
- "[#233][FOLLOWUP] improvement(dashboard): display something xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. Contributor guidelines:
https://github.com/apache/incubator-uniffle/blob/master/CONTRIBUTING.md
3. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
<!--
(Please outline the changes and how this PR fixes the issue.)
-->
This part of `testStorageProvider` should test the default storage media for a non-existent directory. But 47cac3918ff6cdd3873754acc4d6524c4326c604 changed the behavior of `getStorageMediaFor`, now it checks the parent directory (recursively) so for `/path/to/base/dir` it will end up checking `/` which is existent. With this change it will check `path` which is missing, so it will really check the default value.
### 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, describe the bug.)
Fix: # (issue)
-->
```
[INFO] Running org.apache.uniffle.storage.common.DefaultStorageMediaProviderTest
[ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.586 s <<< FAILURE! - in org.apache.uniffle.storage.common.DefaultStorageMediaProviderTest
[ERROR] testStorageProvider Time elapsed: 0.017 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <HDD> but was: <SSD>
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:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1141)
at org.apache.uniffle.storage.common.DefaultStorageMediaProviderTest.testStorageProvider(DefaultStorageMediaProviderTest.java:43)
```
### Does this PR introduce _any_ user-facing change?
<!--
(Please list the user-facing changes introduced by your change, including
1. Change in user-facing APIs.
2. Addition or removal of property keys.)
-->
No.
### How was this patch tested?
<!--
(Please test your changes, and provide instructions on how to test it:
1. If you add a feature or fix a bug, add a test to cover your changes.
2. If you fix a flaky test, repeat it for many times to prove it works.)
-->
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "cchung100m (via GitHub)" <gi...@apache.org>.
cchung100m commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2757267202
Hi @asalamon74
Is it an irrelevant error to PR?
<img width="1114" alt="image" src="https://github.com/user-attachments/assets/2325584e-f19d-42f9-8a29-510974b2083d" />
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2753448355
Could you help review this? @xianjingfeng @advancedxy
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng commented on code in PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#discussion_r2020352841
##########
storage/src/test/java/org/apache/uniffle/storage/common/DefaultStorageMediaProviderTest.java:
##########
@@ -40,7 +40,7 @@ public void testStorageProvider() {
StorageMedia.OBJECT_STORE, provider.getStorageMediaFor("cos://bucket-name/b/path"));
// by default, the local file should report as HDD
- assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("/path/to/base/dir"));
+ assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("path/to/base/dir"));
assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("file:///path/to/a/dir"));
Review Comment:
I think the result of this line is correct, but the underlying logic is wrong. Currently, if the path contains `file://`, `DefaultStorageMediaProvider#getFileStore` will return null. I think the follow line should be changed to
`URI uri = new URI(baseDir);`.
https://github.com/apache/uniffle/blob/76a4dcf76b41529dfda36569140c48c3f0554722/storage/src/main/java/org/apache/uniffle/storage/common/DefaultStorageMediaProvider.java#L65
And then this line should be changed as the follow.
```suggestion
assertEquals(provider.getStorageMediaFor("/") provider.getStorageMediaFor("file:///path/to/a/dir"));
```
WDYT? @advancedxy @asalamon74
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "asalamon74 (via GitHub)" <gi...@apache.org>.
asalamon74 commented on code in PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#discussion_r2028254458
##########
storage/src/test/java/org/apache/uniffle/storage/common/DefaultStorageMediaProviderTest.java:
##########
@@ -40,7 +40,7 @@ public void testStorageProvider() {
StorageMedia.OBJECT_STORE, provider.getStorageMediaFor("cos://bucket-name/b/path"));
// by default, the local file should report as HDD
- assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("/path/to/base/dir"));
+ assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("path/to/base/dir"));
assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("file:///path/to/a/dir"));
Review Comment:
If I change the
```
File baseFile = new File(baseDir);
```
line to
```
URI uri = new URI(baseDir);
```
I've got `java.lang.IllegalArgumentException: Missing scheme` error if we don't use the scheme.
So I think we need both lines. I modified the code, first I use `new File` and if it returns null and the scheme is `file` I'll use the URI approach.
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2748795606
## Test Results
3 011 files ±0 3 011 suites ±0 6h 44m 10s ⏱️ +26s
1 177 tests ±0 1 173 ✅ ±0 1 💤 ±0 3 ❌ ±0
14 914 runs ±0 14 893 ✅ ±0 15 💤 ±0 6 ❌ ±0
For more details on these failures, see [this check](https://github.com/apache/uniffle/runs/39311257793).
Results for commit 3792e827. ± Comparison against base commit cad584a2.
[test-results]:data:application/gzip;base64,H4sIACOO4WcC/03NQQ6DIBCF4asY1l04MBboZRoLmJCqNAgr07t3aIW6fB+Tn51NfnYbu3WiB7h0bMs+nbfNcUw+rCQc+dAT0XsqFwBS1nnfsjE/E397+lexBtPo55Ju4GIMkaRkY16/VdSAx2xVVFo0O6pDhaN6rfscNWFZfKLBhNTcKS6FBXgY+gM1Wq16pQeJ1qGyUo2E7P0BP/hu/xQBAAA=
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "xianjingfeng (via GitHub)" <gi...@apache.org>.
xianjingfeng merged PR #2419:
URL: https://github.com/apache/uniffle/pull/2419
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2781880680
About spotless check failure, you can always to format the code by using the following command before submitting the PR
`mvn spotless:apply -Pspark3 -Pspark2 -Ptez -Pmr -Phadoop2.8`
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "asalamon74 (via GitHub)" <gi...@apache.org>.
asalamon74 commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2757305830
@cchung100m I do think that it's unrelated.
First, the latest official commit shows the exact same error: https://github.com/apache/uniffle/actions/runs/14077620692/job/39423393081
Second, I don't think that a test change in ` DefaultStorageMediaProviderTest` could cause problems in a different test class.
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "asalamon74 (via GitHub)" <gi...@apache.org>.
asalamon74 commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2782152917
Thanks @zuston , I've missed that this PR also have a spotless problem in `DefaultStorageMediaProvider`. I've fixed that.
--
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
Re: [PR] fix(test): Fix test about default storage type for DefaultStorageMediaProviderTest [uniffle]
Posted by "asalamon74 (via GitHub)" <gi...@apache.org>.
asalamon74 commented on PR #2419:
URL: https://github.com/apache/uniffle/pull/2419#issuecomment-2777876844
The docker / spotless errors are unrelated, the master branch has the same errors.
--
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