question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GlobalTracer breaks tests because it can be initialized only once

See original GitHub issue

GlobalTracer.register throws an exception when called again with another tracer instance. It makes unit tests fail if they happen to initialize GlobalTracer.

Has anyone run into this problem? I could run tests in separate JVM instances, but I’d rather not. Maybe adding a “reset” method would make it easier to use for testing purposes?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
yurishkurocommented, Mar 13, 2018

I always like making exceptions more helpful to the users. If this is a common scenario in tests, we should probably extend the exception message to say “if you are getting this exception when running unit tests, see {url}” and link to the doc explaining how tests should be written.

1reaction
pavolloffaycommented, Oct 26, 2017

I think we should rather provide reset method directly on the GlobalTracer. It will make things much simpler, consumers should understand implications when calling it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Design issue: static class only initializes once, breaks unit ...
I would have a problem even without the Null test, because Configuration probably (I'm guessing) gets initialized once for all classes that use ......
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
datadog_trace Changelog - PECL - PHP
This removes one step in onboarding as the environment variable DD_PROFILING_ENABLED no longer needs to be set to 1, which can be difficult...
Read more >
8.4.1 Patch Resolved Issues - Pega Community
is a limit on the amount of cell styles, once the number of rows in the file was ... keydown handler for the...
Read more >
Distributing Tracing Lab - Java
The solution to the lab is located in the directory lab-jaeger-java/solution ... we used this endpoint in the previous section but called it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found