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

OAK-11113 : performed cleanup after running CompressedDocumentPropert… #1749

Merged
merged 6 commits into from
Oct 5, 2024

Conversation

rishabhdaim
Copy link
Contributor

…yStateTest

Copy link
Contributor

@reschke reschke left a comment

Choose a reason for hiding this comment

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

A simpler fix would be to just remove the testnodes in an "@after" method.

That would be much easier if this test class would simply extend AbstractDocumentStoreTest.

@reschke
Copy link
Contributor

reschke commented Sep 29, 2024

Alternate proposal: 009d68e

@@ -92,7 +97,7 @@ public void compressValueThrowsException() throws IOException {
CompressedDocumentPropertyState.setCompressionThreshold(DEFAULT_COMPRESSION_THRESHOLD);
CompressedDocumentPropertyState documentPropertyState = new CompressedDocumentPropertyState(mockDocumentStore, "p", "\"" + STRING_HUGEVALUE + "\"", mockCompression);

assertEquals(documentPropertyState.getValue(Type.STRING), STRING_HUGEVALUE);
assertEquals(STRING_HUGEVALUE, documentPropertyState.getValue(Type.STRING));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

swapped expected & actual values to put them in correct order.

@@ -109,7 +114,7 @@ public void stringAboveThresholdSize() {

assertEquals(result.length, STRING_HUGEVALUE.length() + 2 );

assertEquals(state.getValue(Type.STRING), STRING_HUGEVALUE);
assertEquals(STRING_HUGEVALUE, state.getValue(Type.STRING));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

swapped expected & actual values to put them in correct order.

@@ -125,7 +130,7 @@ public void uncompressValueThrowsException() throws IOException {
CompressedDocumentPropertyState.setCompressionThreshold(DEFAULT_COMPRESSION_THRESHOLD);
PropertyState documentPropertyState = DocumentPropertyStateFactory.createPropertyState(mockDocumentStore, "p", STRING_HUGEVALUE, mockCompression);

assertEquals(documentPropertyState.getValue(Type.STRING), "{}");
assertEquals("{}", documentPropertyState.getValue(Type.STRING));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

swapped expected & actual values to put them in correct order.

@@ -143,11 +148,10 @@ public void testInterestingStringsWithoutCompression() {
}

@Test
public void testOneCompressOtherUncompressInEquals() throws IOException {
public void testOneCompressOtherUncompressInEquals() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Un-necessary throws

}


@Test
public void testEqualsWithCompression() throws IOException {
public void testEqualsWithCompression() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Un-necessary throws

@Before
public void before() throws Exception {
public void before() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Un-necessary throws

Copy link
Contributor

@reschke reschke left a comment

Choose a reason for hiding this comment

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

I'd prefer to make the test extend AbstractDocumentStoreTest and so align it with how other tests that are supposed to run with multiple/specific persistences; see proposal in 009d68e.

The way it is written now is that nsfixtures is ignored, and tests with other flavors of RDB will never be executed. That's why we have a test framework that should be used.

The other changes in test details are good, and I'll be happy to incorporate them into my proposal (see #1751).

@rishabhdaim
Copy link
Contributor Author

@reschke should I update this PR wth your proposed changes in #1751?
Or should I close this so that we can continue on #1751?

@@ -59,7 +59,7 @@ public DocumentMK.Builder getBuilder() {
}

@Before
public void startUp() throws Exception {
public void startUp() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed Un-necessary throws

@reschke
Copy link
Contributor

reschke commented Oct 2, 2024

Please include the changes fromhttps://github.com//pull/1751/commits/e1e7c10a45c24e5998ae6562e23d0ea740bdf969 (Utils has a name mapper), and remove the changes to AbstractDocumentStoreTest (whch I want to update soon anyway).

@rishabhdaim rishabhdaim force-pushed the OAK-11113 branch 2 times, most recently from 4ed8c01 to 641feef Compare October 2, 2024 17:21
}

store = builderProvider.newBuilder().setDocumentStore(ds).getNodeStore();
removeMeClusterNodes.add("" + store.getClusterId());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We required this to avoid recovery from taking place.

@rishabhdaim rishabhdaim merged commit 5ea3304 into trunk Oct 5, 2024
0 of 2 checks passed
@rishabhdaim rishabhdaim deleted the OAK-11113 branch October 5, 2024 08:15
@stefan-egli
Copy link
Contributor

@rishabhdaim noticed that this wasn't squashed - I'm wondering if there's anything to prevent this from happening

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.

3 participants