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

Instrument jsf action calls #2018

Merged
merged 32 commits into from
Jan 20, 2021
Merged

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jan 11, 2021

No description provided.

laurit and others added 4 commits January 14, 2021 18:04
…emetry/javaagent/instrumentation/mojarra/ProcessActionAdvice.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
testing-common/testing-common.gradle Outdated Show resolved Hide resolved
testing-common/testing-common.gradle Outdated Show resolved Hide resolved
}

dependencies {
library group: 'org.apache.myfaces.core', name: 'myfaces-impl', version: '2.3.7'
Copy link
Member

Choose a reason for hiding this comment

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

Right now we have a myfaces-1.2 module that tests version 2+ and a separate 1.2 testing module. Wouldn't it make more sense to keep 1.2 testing in the myfaces-1.2 module and have a separate one for 2+ tests?

Also, have you considered using a separate test task for 2+ tests instead of a separate module? Like jms2Test in the JMS instrumentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this turned out weird. I initially wanted to add integration with only 2.2 and 2.3 but as it turned out to also work for 1.2 I changed the version number to 1.2, but i still wanted to use latestDepTestLibrary to test latest version from 2.x series. As 1.2 & 2.2 have a bit different dependencies I suspect that putting them in one module will make getting them to run with correct dependencies tricky.

laurit and others added 4 commits January 18, 2021 18:03
…ntelemetry/javaagent/instrumentation/myfaces/ActionListenerImplInstrumentation.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
withRetryOnAddressAlreadyInUse(closure, 3)
}

static void withRetryOnAddressAlreadyInUse(Closure<?> closure, int numRetries) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have three retry mechanisms available, gradle-retry-plugin, spock @Retry, and the GitHub actions workflow retry, would be great if we can avoid yet another retry mechanism.

Is it possible to use lazy-loaded singletons instead to take advantage of gradle-retry-plugin?

#1751

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not new code, it was extracted from AgentTestRunner as @mateuszrzeszutek suggested. Anyway ideally such retry should not be needed. To me it seems that for this retry to happen the port returned from PortUtils.randomOpenPort is either not usable (for example PortUtils.randomOpenPort uses socket.setReuseAddress(true); but if server does not then I guess server could fail to bind to that port) or someone else managed to pick the exact same port. It would be best to have each test worker to have its own separate port range that excludes ephemeral ports. Something like https://github.com/gradle/gradle/blob/master/subprojects/core/src/testFixtures/groovy/org/gradle/util/ports/FixedAvailablePortAllocator.groovy As this is not a new issue I would prefer for it to be worked on in a separate pr.

Comment on lines +117 to +118
// wait for thread to start, we expect the first span to be from receive
countDownLatch.await()
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +50 to +52
// JSF spec 7.6.2
// view id is a context relative path to the web application resource that produces the view,
// such as a JSP page or a Facelets page.
Copy link
Member

Choose a reason for hiding this comment

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

👍

<web-fragment version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd">

<!-- without this response status is 200 even when there is an exception -->
Copy link
Member

Choose a reason for hiding this comment

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

👍

@trask trask merged commit 9825ab0 into open-telemetry:master Jan 20, 2021
@laurit laurit deleted the jsf-integration branch February 4, 2021 20:53
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.

5 participants