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

IGNITE-21801 Add missing Schema Sync integration tests #3740

Merged
merged 1 commit into from May 13, 2024

Conversation

rpuch
Copy link
Contributor

@rpuch rpuch commented May 10, 2024

import org.junit.jupiter.api.Test;

@SuppressWarnings("resource")
class ItSchemaSyncConfigTest extends ClusterPerClassIntegrationTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the test class is redundant, the configuration framework should test this behavior and there is no need to double-check it in other modules.

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 an integration test, and it seems usual to test something at a higher level, even if you already tested it using unit tests. Also, this property ('that delayDuration can never be changed') is very important, it's currently a cornerstone for the Schema Sync to work, so a little bit of redundancy here seems to be worth having it.

return schemaCompatValidator.validateBackwards(row.schemaVersion(), tableId(), txId)
.thenAccept(validationResult -> {
if (!validationResult.isSuccessful()) {
throw new IncompatibleSchemaException(String.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

As a suggestion, we could add a constructor that would accept an error message pattern and varags, inside use org.apache.ignite.internal.lang.IgniteStringFormatter#format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure such a change makes the situation so much better. The code at the exception creation site becomes just a bit shorter, but the constructor becomes more complex and now has an additional responsability. I would prefer to leave it in its current state.

@rpuch rpuch merged commit 39556b6 into apache:main May 13, 2024
1 check passed
@rpuch rpuch deleted the ignite-21801 branch May 13, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants