opentracing / opentracing-java

OpenTracing API for Java. 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
1.68k stars 344 forks source link

Add method finishedTraces to MockTracer #277

Closed pavolloffay closed 5 years ago

pavolloffay commented 6 years ago

MockTracer has finishedSpans method, however in tests it's necessary to assert if the spans are in the same trace, therefore, a method like List<List<MockSpan>> finishedTraces would be useful.

yurishkuro commented 6 years ago

sgtm. Alternatively, Map<String, Map<String, Span>>. Returning a List creates an expectation of some predefined order that people may start depending on, even though I've seen RPC frameworks where the order is non-deterministic (i.e. caller client might finish before server span due to event loop blah).

SaumiaSinghal commented 6 years ago

Hie @pavolloffay, @jpkrohling , I would like to work on this issue. Right now, I'm trying to understand the code base. Do you have some slack channel or irc, which I can join for future assistance?

pavolloffay commented 6 years ago

hi @SaumiaSinghal that is great you can ping me on https://gitter.im/opentracing/public

SaumiaSinghal commented 6 years ago

Hie @pavolloffay, I am getting an error while trying to execute ./mvnw clean install. It says:

Failed to execute goal com.mycila:license-maven-plugin:3.0:check (default) on project parent: Some files do not have the expected license header

I searched about it on a couple of resources and tried skipping unit tests, but that also didin't work.

pavolloffay commented 6 years ago

License check is failing. The plugin can fix it with ./mvnw license:format http://code.mycila.com/license-maven-plugin/reports/2.3/format-mojo.html

SaumiaSinghal commented 6 years ago

Thanks for your help @pavolloffay, but now I am getting this error Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project opentracing-api: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?

I will try searching for it and get back to this issue.

jpkrohling commented 6 years ago

@SaumiaSinghal , could you please paste the whole log generated by the mvnw command into a service like https://paste.fedoraproject.org/?

SaumiaSinghal commented 6 years ago

Untitled.txt Okay thanks @jpkrohling :)

jpkrohling commented 6 years ago

Are you getting that as well before applying your changes? If a clean build from the current master completes fine, it would be good to post a diff with your changes.

jpkrohling commented 6 years ago

If it does fail with a clean state (ie, with a fresh clone), then I'd need more info about your environment, like the Java version and the operating system you are using.

SaumiaSinghal commented 6 years ago

Yes @jpkrohling, I cloned the repo again, and I am getting the same error while running ./mvnw clean install, I'm using Ubuntu 18.0.4, and java 10.0.2

jpkrohling commented 6 years ago

That's a nice catch: looks like the build breaks on Java 10. Would you be able to try on Java 8? Or bump JaCoCo to 0.8.2 (see #306)

SaumiaSinghal commented 6 years ago

Thanks @jpkrohling, it works!