Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Cleanup tests with Files#createTempDir() #492

Merged
merged 11 commits into from
Jan 17, 2023

Conversation

kaijchen
Copy link
Contributor

@kaijchen kaijchen commented Jan 16, 2023

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.
This PR should closes #418

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing CI.

@@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be consistent with other modules, I think better ways are to pass a @TempDir in L71-L78's setupServers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with QuorumTest. It will be a lot of changes if we pass tmpDir into setupServers.
I'm OK with both, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2023

Codecov Report

Merging #492 (07955ca) into master (01d37be) will decrease coverage by 2.94%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master     #492      +/-   ##
============================================
- Coverage     61.76%   58.81%   -2.95%     
- Complexity     1697     1706       +9     
============================================
  Files           200      206       +6     
  Lines         10297    11508    +1211     
  Branches       1021     1030       +9     
============================================
+ Hits           6360     6769     +409     
- Misses         3586     4324     +738     
- Partials        351      415      +64     
Impacted Files Coverage Δ
...che/uniffle/server/storage/HdfsStorageManager.java 90.90% <0.00%> (-2.94%) ⬇️
...pache/hadoop/mapreduce/task/reduce/RssFetcher.java 90.76% <0.00%> (-1.54%) ⬇️
.../org/apache/uniffle/server/ShuffleTaskManager.java 76.59% <0.00%> (-0.07%) ⬇️
...pache/uniffle/server/ShuffleServerGrpcService.java 0.79% <0.00%> (-0.02%) ⬇️
...he/uniffle/client/impl/ShuffleWriteClientImpl.java 29.45% <0.00%> (ø)
...bernetes/operator/pkg/controller/controller/rss.go 32.48% <0.00%> (ø)
...oy/kubernetes/operator/pkg/controller/util/util.go 9.37% <0.00%> (ø)
...y/kubernetes/operator/pkg/webhook/inspector/rss.go 47.70% <0.00%> (ø)
deploy/kubernetes/operator/pkg/webhook/manager.go 53.43% <0.00%> (ø)
...y/kubernetes/operator/pkg/webhook/inspector/pod.go 0.00% <0.00%> (ø)
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

advancedxy
advancedxy previously approved these changes Jan 17, 2023
Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaijchen
Copy link
Contributor Author

Thanks @advancedxy for the review. There are a few more cases found, let me include them in this PR too.

Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Merging this, thanks @kaijchen

@advancedxy advancedxy merged commit 6307ecb into apache:master Jan 17, 2023
@kaijchen
Copy link
Contributor Author

Thanks @advancedxy for reviewing.

@kaijchen kaijchen deleted the tempdir branch January 17, 2023 08:49
@kaijchen kaijchen mentioned this pull request Jan 19, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Add until.CreateTempDir
3 participants