-
Notifications
You must be signed in to change notification settings - Fork 1.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
Make High-Level-Rest-Client tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout' #2702
Conversation
Signed-off-by: Tianli Feng <[email protected]>
@@ -84,6 +85,7 @@ | |||
import static org.hamcrest.Matchers.lessThan; | |||
import static org.hamcrest.Matchers.notNullValue; | |||
|
|||
@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/pull/2683") |
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.
Thank you for raising this PR.
I have one concern that muting test classes has potential of introducing bugs from other code changes exercising these two test classes. How do we have plan to cover this ?
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.
Hi @dreamer-89 thank you for reviewing my PR.
My thought is to hold merging this PR until all the other PRs are ready to be merged in #2511. When getting ready, then merging all those PRs together in a short time. The potential of other code changes merged can be reduced by try to shorten the interval of muting the tests.
This is a good point, I should put up some notice saying not to merge this PR in a hurry. 😄
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 @tlfeng for clarifying.
Is it possible we can add OpenSearchRestTestCase.expectWarnings
in tests in above two tests files wherever we are adding master_timeout
. I think this is how we are tackling other deprecated features on client side.
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.
Thank you for your good suggestion!
You are right. 👍 Looks like I should turn off the enableWarningsCheck
https://github.com/opensearch-project/OpenSearch/blob/1.3.1/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java#L407 for the affected test classes.
There are 24 classes extends this class OpenSearchRestHighLevelClientTestCase
(and one class has turned it off https://github.com/opensearch-project/OpenSearch/blob/1.3.1/client/rest-high-level/src/test/java/org/opensearch/client/BulkProcessorIT.java#L89) so the amount of work is reasonable.
I will apply it to the affected test classes.
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.
Updated the code. The enableWarningsCheck
doesn't work for this case, but instead, I found using setStrictDeprecationMode(false)
to build the RestClient can make the test allow deprecation warnings. This will be a safer way 😄.
…cation warning in HLRC tests Signed-off-by: Tianli Feng <[email protected]>
a88317b
to
673e55b
Compare
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...hopefully this won't stay in flight too long.
…, during deprecation of request parameter 'master_timeout' (#2702) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) (#2740) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 6a2a33d)
…, during deprecation of request parameter 'master_timeout' (#2702) (#2741) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 6a2a33d)
…emporarily, during deprecation of request parameter 'master_timeout' (opensearch-project#2702)" This reverts commit 6a2a33d. Signed-off-by: Tianli Feng <[email protected]>
…emporarily, during deprecation of request parameter 'master_timeout' (opensearch-project#2702)" This reverts commit 6a2a33d. Signed-off-by: Tianli Feng <[email protected]>
…emporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2930) This reverts commit 6a2a33d. * Sets the High-Level-Rest-Client tests back to treating warning header as a failure. Signed-off-by: Tianli Feng <[email protected]>
…emporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2930) This reverts commit 6a2a33d. * Sets the High-Level-Rest-Client tests back to treating warning header as a failure. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 91aa312)
…emporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2744) This reverts commit 6a2a33d. During the process of deprecating REST API request parameter master_timeout and adding alternative parameter cluster_manager_timeout, I made High-Level-Rest-Client tests allow deprecation warning temporarily, by changing the argument of `setStrictDeprecationMode()` to false when building `RestClient` for tests, in the above commit / PR #2702, This PR sets the High-Level-Rest-Client tests back to treating warning header as a failure. Signed-off-by: Tianli Feng <[email protected]>
Description
Change:
setStrictDeprecationMode()
tofalse
when building RestClient for tests.Reason:
Many High-Level-Rest-Client tests are broken due to deprecation warning, during the process of deprecating
master_timeout
parameter of REST APIs.The simplest solution is:
false
to make tests allow deprecation warning.cluster_manager_timeout
for all applicable REST APIscluster_manager_timeout
instead ofmaster_timeout
in High-Level-Rest-ClientRequestConverter
classtrue
Note:
WarningFailureException
provides the way to allow warnings in the RestClient tests.A Sample test failure
Issues Resolved
A part of issue #2511
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.