-
Notifications
You must be signed in to change notification settings - Fork 375
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
WebMock::NetConnectNotAllowedError when using dd-trace-rb 1.13.1 with test suite #3050
Comments
@tim-wovn you mentioned that you had an existing configuration for using dd-trace-rb that worked with your tests. Can you share it here? I'd like to compare it with what the auto-detection is doing, see what we can do to support your setup/or what we missed. |
@ivoanjo Sorry for the hassle. Here is some information on my environment:
in
in
Regarding the configuration block, I logged some stats before and after each--namely Datadog.configuration.tracing.enabled, Datadog.configuration.telemetry.enabled, and Datadog.configuration.remote.enabled. Before hitting any configuration block, all three values were true. After the first configuration block, We added the line If
If there is any other information that could be helpful, please let me know and I can try to provide it! Thank you! |
👋, @tim-wovn I think that's all the information we need, thank you for the detailed report! |
Actually, one question: what test runner do you use, @tim-wovn? |
😅 a few more:
|
Thanks for taking the time to look at this!
Mini-test.
Spring is in our gemfile but we're not using it for tests. Just to be sure, I tried the branch you opened #3058 and get the same result I reported for
I don't have the datadog agent installed locally and it isn't installed in CI either. We only have it installed in our staging and production environments. Locally I'm not seeing errors like you mentioned from the rails console. From our end, we have a workaround (setting those 3 variables to false in our config). It's possible (likely?) that we have some custom config that is confusing ddtrace, although I've been poking through our configuration files and I didn't see any likely candidates. |
As a follow-up. I tried to generate a new rails project using the same datadog configuration as in the project I've described. I generated the project using Running tests, |
@marcotc The PR does resolve the issue in both my work project and the Under my work project, I tested opening the rails console under different environments (e.g. For Testing with ddtrace 1.13.1, all three values are true for both Thank you again for your work on this! |
@marcotc I tried out your latest changes, testing with the same setup as before for both my work project and the blog. I'm happy to confirm that everything seems good now! 🎉 For If there is any other info I can provide, please let me know. Thanks again for your work on this! 🙇 |
I pulled updated to 1.15 and all seems well! Thanks again for your work on this! |
Sadly we continue to have this issue on 1.15. I've tried other suggestions to disable during CI and nothing works except removing |
@mcg What does your Mine is like this:
In my gemfile I have: For me, with ddtrace
With ddtrace
With
|
@tim-wovn We only enable DD in the initializer for
Tracing is still true. Do we still need to explicitly disable that for testing? |
@mcg I'm not sure to be honest--although it seems so. In my Checking the history, we added that around the time we upgraded from ddtrace 0.54 to 1.8 I'm guessing that we experienced errors in running tests with tracing enabled by default and we disabled it. To upgrade from ddtrace 1.10 to 1.11 I had to add With |
I tried this In our DD initializer:
and we are still failing with WebMock. The only way I can get this to work is removing
|
@mcg sorry that you're still getting bitten by this! Can I ask you to open a new issue with it, so we can use it to investigate what we missed for your setup? 🙏 |
Current behaviour
Reported by @tim-wovn in #2823 (comment):
Expected behaviour
In #3039 we added support for auto-detecting test environments (and not trying to perform telemetry/remote configuration-related requests), but we may have missed something.
Steps to reproduce
TBA
Environment
Datadog.configure ...
): ?The text was updated successfully, but these errors were encountered: