-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add support for io.etcd:jetcd-core:0.7.5
#170
Conversation
17c16e3
to
83e6767
Compare
e578503
to
d357171
Compare
d357171
to
4c6840a
Compare
|
b2e63c2
to
86f7903
Compare
86f7903
to
1569829
Compare
e3885a3
to
18c4b23
Compare
|
18c4b23
to
2a026e4
Compare
|
2a026e4
to
e193a13
Compare
e193a13
to
971eed0
Compare
|
de0ee97
to
045b8b8
Compare
045b8b8
to
4d2a8d4
Compare
|
65df3ac
to
6a0e33f
Compare
import static org.mockito.Mockito.verify; | ||
|
||
@SuppressWarnings({"SameParameterValue", "ResultOfMethodCallIgnored"}) | ||
// `@org.junit.jupiter.api.Timeout(value = 30)` can't be used in the nativeTest GraalVM CE 22.3 |
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.
Hmm, this may be interesting for our JUnit testing support, do you by any chance remember why @Timeout
didn't work?
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.
- I just need to add back the
@Timeout
annotation of Junit at will, and the factory class of Junit will be incorrectly initialized at build time, and this cannot pass thebuildArgs
of--initialize-at-build-time
to fix. The performance is consistent with the Error Log of the@EnabledOnOs
annotation mentioned in Support testing macos/windows #24. - I'm not sure how much help Provide built-in support for GraalVM native images junit-team/junit5#3040 can provide, because that issue seems to have been silent.
private Watch watchClient; | ||
private ExecutorService executor = Executors.newFixedThreadPool(2); | ||
private AtomicReference<StreamObserver<WatchResponse>> responseObserverRef; | ||
@Mock |
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.
Did you hit any issues with Mockito when writing these tests? I remember there were problems when using it with native-image
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.
- The biggest problem is that the mockito inline plugin cannot be used. I can only use the mockito subclass plugin, which I have configured in
src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
. Of course I also saw more weird issues atArgumentMatchers#argThat
does not work properly when executing GraalVM's NativeTest with the ProxyMockMaker plugin mockito/mockito#2862.
// `@org.junit.jupiter.api.Timeout(value = 30)` can't be used in the nativeTest GraalVM CE 22.3 | ||
public class AuthClientTest { | ||
@RegisterExtension | ||
public static final EtcdClusterExtension cluster = EtcdClusterExtension.builder() |
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.
Does this start a Docker image that contains an Etcd cluster in the background for the purposes of testing?
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.
- Yes,
io.etcd:jetcd-test:0.7.5
is a friendly utility library for launching Etcd Docker Images.
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
// `@org.junit.jupiter.api.Timeout(value = 30)` can't be used in the nativeTest GraalVM CE 22.3 | ||
@Disabled("https://github.com/etcd-io/jetcd/pull/1092") |
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 there a plan to enable these tests in the future? If not, I would remove 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.
- I think it's perfectly fine to remove these tests, as it seems jetcd-core has never been able to fix this.
- If a future version of jetcd-core fixes it, that's something another issue should be talking about, not something this PR should be talking about.
.withNodes(1) | ||
.withSsl(true) | ||
.withAdditionalArgs(Arrays.asList("--auth-token", | ||
"jwt,pub-key=/etc/ssl/etcd/server.pem,priv-key=/etc/ssl/etcd/server-key.pem,sign-method=RS256,ttl=1s")) |
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.
Does this refer to a path inside of the test container that EtcdClusterExtension starts?
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 path refers specifically to the internal path of the Docker Image. The files corresponding to Docker Volumes are in the folder
src/test/resources/ssl/cert/
. Those files are manually generated under Docker Image of Linux. I've noticed that GraalVM Native Build Tools finds these files when packaging even though they don't need to be specified inresource-config.json
.
6a0e33f
to
f36775d
Compare
1145a46
to
8b7a5e5
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.
|
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.
- I completed the nativeTest verification of
io.etcd:jetcd-core:0.7.6
at Add GraalVM Reachability Metadata and corresponding nativeTest for Etcd integration apache/shardingsphere#29755. Fixing nativeTest actually only requires the GraalVM Reachability Metadata ofio.netty:netty-transport-classes-epoll:4.1.99.Final
. - I've opened Add support for
io.netty:netty-transport-classes-epoll:4.1.99.Final
#437. The current PR will be closed.
What does this PR do?
io.etcd:jetcd-core:0.7.5
#164 .org.junit.jupiter.api.Disabled
non-permanently, one of them is fromorg.mockito:mockito-core:4.11.0
Bug, I have opened the corresponding issueArgumentMatchers#argThat
does not work properly when executing GraalVM's NativeTest with the ProxyMockMaker plugin mockito/mockito#2862 yet. Four of them seem to be due to Add param of withBindVolumn for EtcdClusterExtension etcd-io/jetcd#1092 . Two of them seem to be known test bugs ofjetcd-core
, because these tests fail to run in JIT. These things seem to be resolved by future updates of Junit and Mockito.org.junit.jupiter.api.Timeout
annotations temporarily removed, because using this class will cause tests to fail under NativeTest. Looks like a later version of Junit will fix it.Checklist before merging