-
Notifications
You must be signed in to change notification settings - Fork 1k
Convert jaxrs-1.0 tests to java #12745
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
Conversation
| trace -> | ||
| trace.hasSpansSatisfyingExactly( | ||
| span -> | ||
| span.hasName("POST " + getContextPath() + expectedRoute) |
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.
not related to your test, but it's strange to me that the groovy test used the post method but asserted that the spans were GETs
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.
In groovy test the server span isn't created from the actual request but with runWithHttpServerSpan that just uses GET.
| span.hasName("POST " + getContextPath() + expectedRoute) | ||
| .hasKind(SpanKind.SERVER) | ||
| .hasNoParent() | ||
| .hasAttributesSatisfying( |
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.
are we intentionally avoiding using hasAttributesSatisfyingExactly here so that we don't need to to assert all the other attributes on this span? Also the groovy tests expected an error.type that I don't see on this test's spans, is that an artifact of us switching the test dependencies from using the dropwizard testing package to using jetty directly?
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, I intentionally skipped listing all attributes, but I guess they could be added for consistency with other tests. I was also confused by the error.type it is added because runWithHttpServerSpan uses
Line 138 in e27a76a
| private enum HttpServerGetter implements HttpServerAttributesGetter<String, Void> { |
null from getHttpResponseStatusCode and Line 106 in e27a76a
| errorType = getter.getErrorType(request, response, error); |
null as non successful request. I suspect this behavior might not conform to the spec as the spec says If the request has completed successfully, instrumentations SHOULD NOT set error.type. Does lack of status code mean that the request has failed? Imo not too important as real instrumentations always set the status code, and if they don't then there really must have been an error. cc @trask
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 ok to interpret null response status code as "not completed successfully", since a "successful" HTTP response would always have a response status code
Part of #7195