Skip to content
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

Use ratpack 1.4.1 for testing #4748

Merged
merged 5 commits into from
Nov 30, 2021
Merged

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 30, 2021

Resolves #4736
Resolves #4618
I believe that the flakiness of ratpack tests is caused by a bug in ratpack that was fixed in this commit ratpack/ratpack@dde536a
Basically due to using wrong type of queue some threads will end in a busy loop inside queue implementation because internal state of the queue has been corrupted. Here is a sample of such stuck thread

"ratpack-compute-4-21" #148 prio=10 os_prio=31 cpu=753872.20ms elapsed=755.42s tid=0x00007fae2d0bb000 nid=0xd01f runnable  [0x000070000a623000]
   java.lang.Thread.State: RUNNABLE
        at io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueue.poll(BaseMpscLinkedArrayQueue.java:340)
        at io.netty.util.internal.shaded.org.jctools.queues.MpscUnboundedArrayQueue.poll(MpscUnboundedArrayQueue.java:23)
        at ratpack.exec.util.Promised.drain(Promised.java:143)
        at ratpack.exec.util.Promised.accept(Promised.java:131)
        at ratpack.exec.util.Promised.success(Promised.java:106)
        at ratpack.exec.internal.DefaultExecution$1.lambda$success$1(DefaultExecution.java:136)
        at ratpack.exec.internal.DefaultExecution$1$$Lambda$768/0x00000008009e0040.execute(Unknown Source)
        at io.opentelemetry.javaagent.instrumentation.ratpack.BlockWrapper.execute(BlockWrapper.java:26)
        at ratpack.exec.internal.DefaultExecution$SingleEventExecStream.exec(DefaultExecution.java:442)
        at ratpack.exec.internal.DefaultExecution.exec(DefaultExecution.java:222)
        at ratpack.exec.internal.DefaultExecution.intercept(DefaultExecution.java:215)
        at ratpack.exec.internal.DefaultExecution.drain(DefaultExecution.java:195)
        at ratpack.exec.internal.DefaultExecution.<init>(DefaultExecution.java:95)
        at ratpack.exec.internal.DefaultExecController$1.lambda$start$0(DefaultExecController.java:172)
        at ratpack.exec.internal.DefaultExecController$1$$Lambda$854/0x0000000800ad9840.call(Unknown Source)
        at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:96)
        at io.netty.util.concurrent.PromiseTask.run(PromiseTask.java:106)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:113)
        at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory$$Lambda$646/0x00000008008dbc40.run(Unknown Source)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run([email protected]/Thread.java:834)

@@ -92,7 +92,10 @@ abstract class NettyAlignmentRule : ComponentMetadataRule {
dependencies {
add(dependencyManagementConf.name, platform(project(":dependencyManagement")))

components.all<NettyAlignmentRule>()
// ratpack tests don't work correctly with 4.1.65.Final
Copy link
Member

Choose a reason for hiding this comment

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

is this a separate flaky issue?

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 problem is that besides the fix that hopefully gets rid of the flakiness there is another change that breaks some tests when run with netty 4.1.65. These tests pass when run with the netty version that ratpack depends on. All tests in RatpackPooledHttpClientTest fail, from other http client tests only highConcurrencyOnSingleConnection fails, there are also failures under library tests.

Comment on lines +32 to +46
// to allow all tests to pass we need to choose a specific netty version
if (!(findProperty("testLatestDeps") as Boolean)) {
configurations.configureEach {
if (!name.contains("muzzle")) {
resolutionStrategy {
eachDependency {
// specifying a fixed version for all libraries with io.netty group
if (requested.group == "io.netty") {
useVersion("4.1.31.Final")
}
}
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

thx 👍

@trask trask merged commit 95f3d37 into open-telemetry:main Nov 30, 2021
trask added a commit that referenced this pull request Dec 1, 2021
* Use ratpack 1.4.1 for testing

* don't force netty version in ratpack tests

* spotless

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <[email protected]>

* enable https test

Co-authored-by: Trask Stalnaker <[email protected]>

Co-authored-by: Lauri Tulmin <[email protected]>
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Use ratpack 1.4.1 for testing

* don't force netty version in ratpack tests

* spotless

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <[email protected]>

* enable https test

Co-authored-by: Trask Stalnaker <[email protected]>
@laurit laurit deleted the test-on-ratpack-1.4.1 branch July 6, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants