-
Notifications
You must be signed in to change notification settings - Fork 406
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
[#2414] improved(core): Make the unit tests for entity storage unified in the core module #2545
Conversation
@@ -0,0 +1,71 @@ | |||
/* | |||
* Copyright 2023 Datastrato Pvt Ltd. |
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.
Only the package path was changed, so the original license was maintained.
public static final String KV_STORE_PATH = | ||
"/tmp/gravitino_kv_entityStore_" + UUID.randomUUID().toString().replace("-", ""); | ||
|
||
private static final String JDBC_STORE_PATH = |
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.
Why do we need the storage path when using JDBC storage? Is the directory for storing H2 files there?
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.
H2 supports some connection modes, here we use the embedded mode to save the data, see: https://www.h2database.com/html/features.html#embedded_databases
core/src/test/java/com/datastrato/gravitino/storage/TestEntityStorage.java
Outdated
Show resolved
Hide resolved
@@ -234,4 +236,164 @@ void testRemoveWithGCCollector() throws IOException, InterruptedException { | |||
} | |||
} | |||
} | |||
|
|||
@Test | |||
void testRemoveWithGCCollector2() throws IOException, InterruptedException { |
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.
What's the difference between testRemoveWithGCCollector2
and the old one?
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.
The unit test testRemoveWithGCCollector2
was originally saved in the TestKvEntityStorage
class. Since it has the same name as the unit test method in TestKvGarbageCollector
, 1
and 2
are added to distinguish them. The test logic of testRemoveWithGCCollector1
and testRemoveWithGCCollector2
is slightly different, and there is no direct deletion here.
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
…unified in the core module (apache#2545) ### What changes were proposed in this pull request? The purpose of this PR is to unify some of the unit tests of the `Entity Store` to ensure that the same results can be obtained. ### Why are the changes needed? Fix: apache#2414 ### How was this patch tested? Using the modified unit tests. --------- Co-authored-by: xiaojiebao <[email protected]>
What changes were proposed in this pull request?
The purpose of this PR is to unify some of the unit tests of the
Entity Store
to ensure that the same results can be obtained.Why are the changes needed?
Fix: #2414
How was this patch tested?
Using the modified unit tests.