Skip to content

Comments

[KARAF-4542] - add '--repository' option to feature:list#1642

Merged
jbonofre merged 1 commit intoapache:mainfrom
awrb:KARAF-4542
Oct 12, 2022
Merged

[KARAF-4542] - add '--repository' option to feature:list#1642
jbonofre merged 1 commit intoapache:mainfrom
awrb:KARAF-4542

Conversation

@awrb
Copy link
Contributor

@awrb awrb commented Oct 10, 2022

No description provided.

@jbonofre jbonofre self-requested a review October 11, 2022 08:21
@jbonofre
Copy link
Member

@awrb FYI, I gonna take a new look on GraphQLExample test as it seems the websocket test is flaky and causing PRs build failure.

@awrb
Copy link
Contributor Author

awrb commented Oct 11, 2022

Whoops, I will check this in the evening (unless I see a commit that fixes that by then). I ran the websocket test several times locally though and never had any problems so I might not be able to reproduce it :/

@Option(name = "-o", aliases = {"--ordered"}, description = "Display a list using alphabetical order ", required = false, multiValued = false)
boolean ordered;

@Option(name = "--repository", description = "Only list features from that repository", required = false, multiValued = false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ticket suggested to use name = "-r" but since then it was used for another option (--required). So I used full name here.

Copy link
Member

Choose a reason for hiding this comment

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

You did right ! --repository looks good to me.

@awrb
Copy link
Contributor Author

awrb commented Oct 12, 2022

I was able to reproduce the test failing locally too (sometimes) running mvn clean test -Dtest=GraphQLExampleTest. When it failed, it looked like it was being run twice, failing once and passing the second time:

GraphQLExampleTest: testWebSocket
Connecting websocket client
junit.framework.AssertionFailedError
        at junit.framework.Assert.fail(Assert.java:55)
        at junit.framework.Assert.assertTrue(Assert.java:22)
        at junit.framework.Assert.assertTrue(Assert.java:31)
        at junit.framework.TestCase.assertTrue(TestCase.java:201)
        at org.apache.karaf.itests.examples.GraphQLExampleTest.testWebSocket(GraphQLExampleTest.java:110)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
        at org.apache.karaf.itests.KarafTestSupport$Retry$1.evaluate(KarafTestSupport.java:160)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runLeafWithRetry(ContainerTestRunner.java:97)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChildWithRetry(ContainerTestRunner.java:84)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:75)
        at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:43)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)
        at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:85)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

GraphQLExampleTest: testWebSocket
Connecting websocket client
Received websocket message: {bookCreated={id=5, name=Lord of the Rings}}
Closing websocket client

the first time @OnWebSocketMessage is not called.

I played around with pax-exam options a bit, changed reactor strategy to PerClass, changed to using @configuration rather than installing features manually but it did not help yet.
I don't think this is a problem with the servlet request because using

        executeCommand("graphql:query " +  "\"mutation { addBook(name:Test pageCount:100) { id name } }\"");

rather than POST to trigger the websocket message did not help.

@jbonofre
Copy link
Member

@awrb I think it could also conflict with the WebsocketExample. It would be great to avoid this kind of flaky tests.

@jbonofre jbonofre merged commit 0697da7 into apache:main Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants