-
Notifications
You must be signed in to change notification settings - Fork 73
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
Build on JDK 8, revert private build of protostuff. #418
Conversation
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]>
/** | ||
* Mockito does not allow mock final methods. Make my own delegates and mock them. | ||
* | ||
*/ |
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.
This seems to have been written to avoid precisely the mockito problem:
Suite: Test class org.opensearch.action.admin.indices.mapping.get.ValidateAnomalyDetectorActionHandlerTests
1> [2022-03-11T06:01:02,966][INFO ][o.o.a.a.i.m.g.ValidateAnomalyDetectorActionHandlerTests] [testValidateMoreThanTenMultiEntityDetectorsLimit] before test
1> [2022-03-11T06:01:04,994][INFO ][o.o.a.a.i.m.g.ValidateAnomalyDetectorActionHandlerTests] [testValidateMoreThanTenMultiEntityDetectorsLimit] after test
2> REPRODUCE WITH: ./gradlew ':test' --tests "org.opensearch.action.admin.indices.mapping.get.ValidateAnomalyDetectorActionHandlerTests.testValidateMoreThanTenMultiEntityDetect
orsLimit" -Dtests.seed=985E69252C997DD5 -Dtests.security.manager=false -Dtests.locale=et-EE -Dtests.timezone=Etc/GMT-9 -Druntime.java=8
2> org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class org.opensearch.action.admin.indices.mapping.get.IndexAnomalyDetectorActionHandlerTests$4.
Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 1.8
JVM vendor name : Private Build
JVM vendor version : 25.312-b07
JVM name : OpenJDK 64-Bit Server VM
JVM version : 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07
JVM info : mixed mode
OS name : Linux
OS version : 5.13.0-1014-aws
Underlying exception : java.lang.IllegalStateException: Error invoking java.lang.ClassLoader#defineClass
at __randomizedtesting.SeedInfo.seed([985E69252C997DD5:A070E1A9435257DF]:0)
at org.opensearch.mockito.plugin.PriviledgedMockMaker.lambda$createMock$4(PriviledgedMockMaker.java:77)
at java.security.AccessController.doPrivileged(Native Method)
at org.opensearch.mockito.plugin.PriviledgedMockMaker.createMock(PriviledgedMockMaker.java:77)
at org.opensearch.action.admin.indices.mapping.get.ValidateAnomalyDetectorActionHandlerTests.testValidateMoreThanTenMultiEntityDetectorsLimit(ValidateAnomalyDetectorActio
nHandlerTests.java:222)
Caused by:
java.lang.IllegalStateException: Error invoking java.lang.ClassLoader#defineClass
at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$Dispatcher$Direct.defineClass(ClassInjector.java:609)
I couldn't make it work, and since this affects tests only and we're dropping support for JDK8 in 2.0, ignoring the handful of tests seems ok.
The code is unused, deleting.
Signed-off-by: dblock <[email protected]>
… test coverage. Signed-off-by: dblock <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #418 +/- ##
============================================
+ Coverage 77.56% 77.72% +0.16%
- Complexity 4107 4111 +4
============================================
Files 296 296
Lines 17655 17669 +14
Branches 1876 1878 +2
============================================
+ Hits 13694 13734 +40
+ Misses 3057 3034 -23
+ Partials 904 901 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…pensearch-project#427. Signed-off-by: dblock <[email protected]>
Signed-off-by: dblock <[email protected]> (cherry picked from commit c0218e5)
Signed-off-by: dblock <[email protected]> (cherry picked from commit c0218e5)
Signed-off-by: dblock <[email protected]> (cherry picked from commit c0218e5)
Signed-off-by: dblock <[email protected]> (cherry picked from commit c0218e5)
Signed-off-by: dblock [email protected]
Description
Issues Resolved
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.