-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Migrate query JDBC, cancel and system tables tests, cleanup and refactor helper classes #18805
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
Conversation
kfaraz
left a comment
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 for the changes, @Fly-Style !
The tests look much better now.
I have left some minor suggestions. Please let me know what you think.
| // Add in the consecutive patch | ||
| // StringUtils.format( | ||
| // TLS_CONNECTION_TEMPLATE, | ||
| // config.getRouterTLSUrl(), | ||
| // sslConfig.getTrustStorePath(), | ||
| // sslConfig.getTrustStorePasswordProvider().getPassword(), | ||
| // sslConfig.getKeyStorePath(), | ||
| // sslConfig.getKeyStorePasswordProvider().getPassword(), | ||
| // sslConfig.getKeyManagerPasswordProvider().getPassword() | ||
| //), | ||
| // StringUtils.format( | ||
| // TLS_CONNECTION_TEMPLATE, | ||
| // config.getBrokerTLSUrl(), | ||
| // sslConfig.getTrustStorePath(), | ||
| // sslConfig.getTrustStorePasswordProvider().getPassword(), | ||
| // sslConfig.getKeyStorePath(), | ||
| // sslConfig.getKeyStorePasswordProvider().getPassword(), | ||
| // sslConfig.getKeyManagerPasswordProvider().getPassword() | ||
| // ) |
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.
Please remove the commented out code. We can just add one line to the javadoc of this class that mentions that the TLS flavor for this test will be added later.
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.
| dataLoaderHelper.waitUntilDatasourceIsReady("wikipedia"); | ||
| dataLoaderHelper.waitUntilDatasourceIsReady("twitterstream"); | ||
|
|
||
| tableName = ingestBasicData(); |
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.
Nit: In Druid, we generally use the term datasource. Maybe rename this field to testDataSource or similar?
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.
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.
Rename pending?
| // Wait until the sqlLifecycle is authorized and registered | ||
| Thread.sleep(500L); |
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.
Is this needed in the embedded test framework too?
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.
In that case, unfortunately, yes. We need to give query some time to spin up :)
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.
oh, I see. Could you we wait on a metric instead, say sqlQuery/planningTimeMs?
There could be other metrics too which mark the execution start of the query.
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SqlQueryCancelTest.java
Outdated
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SqlQueryCancelTest.java
Outdated
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/JdbcQueryTest.java
Outdated
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/JdbcQueryTest.java
Outdated
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SystemTableQueryTest.java
Outdated
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SystemTableQueryTest.java
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SystemTableQueryTest.java
Outdated
Show resolved
Hide resolved
kfaraz
left a comment
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.
Looks good! Only blocking comments are these:
- Use
ingestBasicData()inSystemTableQueryTest - Remove
sleep()fromSqlQueryCancelTestby using some appropriate metric
| dataLoaderHelper.waitUntilDatasourceIsReady("wikipedia"); | ||
| dataLoaderHelper.waitUntilDatasourceIsReady("twitterstream"); | ||
|
|
||
| tableName = ingestBasicData(); |
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.
Rename pending?
| URL url; | ||
| try { | ||
| url = new URL(endpoint); | ||
| } | ||
| catch (MalformedURLException e) { | ||
| throw new AssertionError("Malformed URL"); | ||
| } | ||
|
|
||
| Request request = new Request(HttpMethod.POST, url); | ||
| request.addHeader("Content-Type", MediaType.APPLICATION_JSON); | ||
| request.setContent(query.getBytes(StandardCharsets.UTF_8)); | ||
| return httpClientRef.go(request, StatusResponseHandler.getInstance()); |
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.
We can try to augment the EmbeddedClusterApis to provide this functionality and also some API to cancel queries in a follow up PR. Not needed right now.
integration-tests/docker/environment-configs/historical-for-query-error-test
Show resolved
Hide resolved
embedded-tests/src/test/java/org/apache/druid/testing/embedded/query/SystemTableQueryTest.java
Outdated
Show resolved
Hide resolved
kfaraz
left a comment
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 for fixing these up, @Fly-Style !
Happy to get rid of these ITs! 😛
|
|
|
Merging this off as failures are unrelated. |
…dded tests (#18867) Changes: - Replace `ITAppendBatchIndexTest` with a new method in `IndexParallelTaskTest` - Migrate `ITCustomCoordinatorDutiesTest` to embedded tests as `KillSupervisorsCustomDutyTest` - Remove the following test groups since all the tests for that group have already been migrated - `input-source` (#18805, #18752) - `cds-task-schema-publish-disabled` - `cds-coordinator-metadata-query-disabled`
Description
This patch continues the effort to move query group tests to the embedded test suite, currently, we have migrated
ITSqlCancelTest,ITSystemTableQueryTest,ITTwitterQueryTest.Note: TLS-related tests require more effort to support, so we decided to implement them in subsequent patches.
This PR has: