-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add test for DoraMetaManager #18127
Add test for DoraMetaManager #18127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will leave some comments :)
dora/core/server/worker/src/test/java/alluxio/worker/netty/WriteRequestTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/UnsupportedMessageHandlerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/main/java/alluxio/worker/dora/DoraMetaManager.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/netty/UnsupportedMessageHandlerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Voddle, I leave some comments. :)
dora/core/server/worker/src/test/java/alluxio/worker/netty/UfsFileWriteHandlerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
BTW, please fix your checkstyle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is nearly finished, thanks, I leave some comments.
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
if (testDir.exists()) { | ||
deleteDirectory(testDir); | ||
} else { | ||
throw new RuntimeException("testDir doesn't exist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the directory is not existing, how about do nothing? I'm not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it not existing, somethings must be wrong 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now would you mind delete this method? Actually we don't create any files in the directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testDir
now is hard coded as 'alluxio/dora/core/worker', without here will leave an annoying directory, or we change it to tmpfile
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Show resolved
Hide resolved
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! these are my last comments I think.
if (testDir.exists()) { | ||
deleteDirectory(testDir); | ||
} else { | ||
throw new RuntimeException("testDir doesn't exist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now would you mind delete this method? Actually we don't create any files in the directory.
dora/core/server/worker/src/test/java/alluxio/worker/dora/DoraMetaManagerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM with a few comments. Thanks for the work!
} catch (IOException e) { | ||
mManager = null; | ||
} | ||
File testDir = new File(mTestMetaStorePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea use TemporaryFolder
, which deletes itself when jvm exits
@Before | ||
public void before() throws IOException { | ||
AlluxioProperties prop = new AlluxioProperties(); | ||
prop.set(PropertyKey.DORA_WORKER_METASTORE_ROCKSDB_DIR, String.format("%s/metastore", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here utilize the TemporaryFolder you are going to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
alluxio-bot, merge this please |
Add DoraMetaManagerTest.