hypertrace / javaagent

Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Apache License 2.0
30 stars 15 forks source link

Align SB smoke test image with servlet containers #330

Closed pavolloffay closed 3 years ago

pavolloffay commented 3 years ago

The undertow tests seems to be flaky

UndertowInstrumentationTest > postUrlEncoded() FAILED
    org.opentest4j.AssertionFailedError at UndertowInstrumentationTest.java:113

cc) @ryandens

ryandens commented 3 years ago

The undertow tests seems to be flaky

UndertowInstrumentationTest > postUrlEncoded() FAILED
    org.opentest4j.AssertionFailedError at UndertowInstrumentationTest.java:113

cc) @ryandens

Thanks! I noticed this as well, still trying to zero in on the source of the flakiness, but working on this in the background. I have a suspicion that it's a thread-safety issue with how that test utilizes the in-memory exporter, so at least it doesn't seem to be an inconsistency issue with the production agent code 🤞

pavolloffay commented 3 years ago

on JDK8 it fails randomly.

while ./gradlew clean :instrumentation:undertow:undertow-1.4:test; do :; done
pavolloffay commented 3 years ago

I have a suspicion that it's a thread-safety issue with how that test utilizes the in-memory exporter, so at least it doesn't seem to be an inconsistency issue with the production agent code crossed_fingers

I would not be so sure bc spans are reported but the body attribute is missing.

ryandens commented 3 years ago

I have a suspicion that it's a thread-safety issue with how that test utilizes the in-memory exporter, so at least it doesn't seem to be an inconsistency issue with the production agent code crossed_fingers

I would not be so sure bc spans are reported but the body attribute is missing.

Huh, interesting. Where are you seeing that? The test failure you posted (and that I've seen as well) shows the assertion in line 113 failing which is just asserting the size of the traces list? Do the logs show the trace reported without the body attribute? Or did you get a test failure with a different assertion error?

pavolloffay commented 3 years ago

I get failures in my editor on line 117 ass well :/

    assertEquals(
        "{\"echo\": \"bar\"}",
        spanData.getAttributes().get(HypertraceSemanticAttributes.HTTP_RESPONSE_BODY));
ryandens commented 3 years ago

Thanks! I hadn't gotten that one yet, but this will definitely help

pavolloffay commented 3 years ago

The failing line 117 is my bad, wrongly initialized classpath in IDE, here is the fix for the flaky test https://github.com/hypertrace/javaagent/pull/331