You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2023/01/16 12:31:30 UTC
[GitHub] [incubator-uniffle] kaijchen opened a new pull request, #492: [Test] Cleanup tests with Files#createTempDir()
kaijchen opened a new pull request, #492:
URL: https://github.com/apache/incubator-uniffle/pull/492
### What changes were proposed in this pull request?
Replace `Files#createTempDir()` with `@TempDir`.
Cleanup some tests.
### Why are the changes needed?
`Files#createTempDir()` is deprecated, it's better to use `@TempDir` from JUnit 5.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing CI.
--
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 #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#issuecomment-1384018162
# [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/492?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 [#492](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0bcbfe5) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/01d37bebf522d9be8a1a28a45eb4ba590011807c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (01d37be) will **decrease** coverage by `3.00%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #492 +/- ##
============================================
- Coverage 61.76% 58.76% -3.01%
Complexity 1697 1697
============================================
Files 200 206 +6
Lines 10297 11458 +1161
Branches 1021 1021
============================================
+ Hits 6360 6733 +373
- Misses 3586 4314 +728
- Partials 351 411 +60
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...y/kubernetes/operator/pkg/webhook/inspector/pod.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svaW5zcGVjdG9yL3BvZC5nbw==) | `0.00% <0.00%> (ø)` | |
| [...oy/kubernetes/operator/pkg/controller/util/util.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL2NvbnRyb2xsZXIvdXRpbC91dGlsLmdv) | `9.37% <0.00%> (ø)` | |
| [...y/kubernetes/operator/pkg/webhook/inspector/rss.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svaW5zcGVjdG9yL3Jzcy5nbw==) | `47.70% <0.00%> (ø)` | |
| [...bernetes/operator/pkg/controller/controller/rss.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL2NvbnRyb2xsZXIvY29udHJvbGxlci9yc3MuZ28=) | `32.48% <0.00%> (ø)` | |
| [...rnetes/operator/pkg/webhook/inspector/inspector.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svaW5zcGVjdG9yL2luc3BlY3Rvci5nbw==) | `69.56% <0.00%> (ø)` | |
| [deploy/kubernetes/operator/pkg/webhook/manager.go](https://codecov.io/gh/apache/incubator-uniffle/pull/492?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svbWFuYWdlci5nbw==) | `53.43% <0.00%> (ø)` | |
: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] kaijchen commented on pull request #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
kaijchen commented on PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#issuecomment-1384774272
Thanks @advancedxy for the review. There are a few more cases found, let me include them in this PR too.
--
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] advancedxy merged pull request #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
advancedxy merged PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492
--
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 #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#discussion_r1071226867
##########
integration-test/common/src/test/java/org/apache/uniffle/test/QuorumTest.java:
##########
@@ -146,36 +153,14 @@ public static void cleanCluster() throws Exception {
coordinators = Lists.newArrayList();
}
- @BeforeEach
- public void initEnv() throws Exception {
- // spark.rss.data.replica=3
- // spark.rss.data.replica.write=2
- // spark.rss.data.replica.read=2
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo0)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo1)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo2)).adjustTimeout(200);
- }
-
@AfterEach
public void cleanEnv() throws Exception {
if (shuffleWriteClientImpl != null) {
shuffleWriteClientImpl.close();
}
cleanCluster();
- initCluster();
- // we need recovery `rpcTime`, or some unit tests may fail
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
Review Comment:
Immediately after the `@AfterEach`, the `@BeforeEach initEnv()` is executed, which overwrites those values.
However, I agree it's probably better to change this in another 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@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 #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#discussion_r1071238160
##########
integration-test/common/src/test/java/org/apache/uniffle/test/QuorumTest.java:
##########
@@ -146,36 +153,14 @@ public static void cleanCluster() throws Exception {
coordinators = Lists.newArrayList();
}
- @BeforeEach
- public void initEnv() throws Exception {
- // spark.rss.data.replica=3
- // spark.rss.data.replica.write=2
- // spark.rss.data.replica.read=2
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo0)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo1)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo2)).adjustTimeout(200);
- }
-
@AfterEach
public void cleanEnv() throws Exception {
if (shuffleWriteClientImpl != null) {
shuffleWriteClientImpl.close();
}
cleanCluster();
- initCluster();
- // we need recovery `rpcTime`, or some unit tests may fail
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
Review Comment:
@frankliee what's the initial purpose of these 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] kaijchen commented on a diff in pull request #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
kaijchen commented on code in PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#discussion_r1071231805
##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleServerFaultToleranceTest.java:
##########
@@ -245,8 +246,6 @@ public static MockedShuffleServer createServer(int id) throws Exception {
shuffleServerConf.set(ShuffleServerConf.SERVER_APP_EXPIRED_WITHOUT_HEARTBEAT, 5000L);
shuffleServerConf.set(ShuffleServerConf.DISK_CAPACITY, 1000000L);
shuffleServerConf.setLong("rss.server.heartbeat.interval", 5000);
- File tmpDir = Files.createTempDir();
Review Comment:
This is consistent with QuorumTest. It will be a lot of changes if we pass `tmpDir` into `setupServers`.
I'm OK with both, though.
--
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] advancedxy commented on a diff in pull request #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
advancedxy commented on code in PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#discussion_r1071244426
##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleServerFaultToleranceTest.java:
##########
@@ -245,8 +246,6 @@ public static MockedShuffleServer createServer(int id) throws Exception {
shuffleServerConf.set(ShuffleServerConf.SERVER_APP_EXPIRED_WITHOUT_HEARTBEAT, 5000L);
shuffleServerConf.set(ShuffleServerConf.DISK_CAPACITY, 1000000L);
shuffleServerConf.setLong("rss.server.heartbeat.interval", 5000);
- File tmpDir = Files.createTempDir();
Review Comment:
> It will be a lot of changes if we pass tmpDir into setupServers
How many changes are we talking about? If there's too many changes, I'm ok with current PR.
And also, why so many changes are required?
--
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] advancedxy commented on a diff in pull request #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
advancedxy commented on code in PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#discussion_r1071192561
##########
integration-test/common/src/test/java/org/apache/uniffle/test/AssignmentWithTagsTest.java:
##########
@@ -112,7 +109,7 @@ private static void createAndStartShuffleServerWithTags(Set<String> tags) throws
}
@BeforeAll
- public static void setupServers() throws Exception {
+ public static void setupServers(@TempDir File dir1, @TempDir File dir2, @TempDir File dir3) throws Exception {
Review Comment:
One `TempDir` should be enough?
The three tempdir could be sub-dirs of the TempDir.
##########
integration-test/common/src/test/java/org/apache/uniffle/test/QuorumTest.java:
##########
@@ -146,36 +153,14 @@ public static void cleanCluster() throws Exception {
coordinators = Lists.newArrayList();
}
- @BeforeEach
- public void initEnv() throws Exception {
- // spark.rss.data.replica=3
- // spark.rss.data.replica.write=2
- // spark.rss.data.replica.read=2
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo0)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo1)).adjustTimeout(200);
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
- .getInstance().getShuffleServerClient("GRPC", shuffleServerInfo2)).adjustTimeout(200);
- }
-
@AfterEach
public void cleanEnv() throws Exception {
if (shuffleWriteClientImpl != null) {
shuffleWriteClientImpl.close();
}
cleanCluster();
- initCluster();
- // we need recovery `rpcTime`, or some unit tests may fail
- ((ShuffleServerGrpcClient)ShuffleServerClientFactory
Review Comment:
this should be rolled back?
##########
integration-test/common/src/test/java/org/apache/uniffle/test/ShuffleServerFaultToleranceTest.java:
##########
@@ -245,8 +246,6 @@ public static MockedShuffleServer createServer(int id) throws Exception {
shuffleServerConf.set(ShuffleServerConf.SERVER_APP_EXPIRED_WITHOUT_HEARTBEAT, 5000L);
shuffleServerConf.set(ShuffleServerConf.DISK_CAPACITY, 1000000L);
shuffleServerConf.setLong("rss.server.heartbeat.interval", 5000);
- File tmpDir = Files.createTempDir();
Review Comment:
to be consistent with other modules, I think better ways are to pass a `@TempDir` in L71-L78's `setupServers`.
--
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 #492: [Test] Cleanup tests with Files#createTempDir()
Posted by GitBox <gi...@apache.org>.
kaijchen commented on PR #492:
URL: https://github.com/apache/incubator-uniffle/pull/492#issuecomment-1385038875
Thanks @advancedxy for reviewing.
--
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