-
Notifications
You must be signed in to change notification settings - Fork 410
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
DDTrace is incompatible with pytest 8 #8220
Comments
can confirm seeing the same issue in both 7.2.0 and 8.0.0 |
Thanks for bringing this to our attention, @ravirahman. I've added a ticket about this to an internal backlog, and it will be included in future prioritization passes. |
I'm gonna reopen this since there's a comment about I set up an environment with:
pip freeze
In both cases, I successfully ran tests with
So whatever's going on isn't strictly related to @ravirahman , are you only seeing this failure when you upgrade to @jhilimirejc , are you seeing the same traceback, give or take?
|
@ravirahman , it'd be helpful if you could also try without using @jhilimirejc more details from you would be very welcome as well. |
pytest-dev/pytest#11137 does look like a potentially related change here, though if that were the case, it seems like I should definitely see a failure with There's a follow-up for me to have a default behavior for the module/suite/test naming hooks that doesn't cause exceptions (and if it does, that we just fail within |
I can reproduce the same failure with Starlette ( @jhilimirejc , if you could confirm whether you're seeing the same stacktrace with |
@romainkomorndatadog -We are not using pytest-xdist. However we had our version pinned at 1.20.2 and saw the same error, we attempted to upgrade and continue to see the same issue regardless of ddtrace or pytest versions [tool.poetry.dependencies] [tool.poetry.dev-dependencies] (upgraded ddtrace, cattrs & attrs along with typing_extensions- and even tried pytest at 8.0.0 and still come across same error) |
while our version of pytest is careted - i've pinned it to 7.20.0 and also see the same output: INTERNALERROR> Traceback (most recent call last): |
I put together a simple reproducer that can be found here: https://github.com/iherasymenko/ddtrace-8220-reproducer. The key to trigger this error is to have a test file placed in a module. |
As an update, I've got a WIP PR to support pytest @jhilimirejc , it would be very helpful if you could come up with a small repro case for Pytest And @iherasymenko , thank you so much for that repro case. Definitely saved me some time. |
For visibility here, I just wrote #8357 (comment) to say I need to take on a bit of a deeper rewrite of our It'll be a slower turnaround but the changes are also needed for other work we have scheduled around telemetry and log collection. |
Addresses #8220 and fixes an issue with `pytest` `8.x` and above (brought by pytest-dev/pytest#11137 ) where `pytest.Package` objects no longer have an attached `module` attribute. This also changes the testing matrix to include version `~=8.0`, but maintains `~=7.0` as a separate testing environment. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Munir Abdinur <[email protected]>
Addresses #8220 and fixes an issue with `pytest` `8.x` and above (brought by pytest-dev/pytest#11137 ) where `pytest.Package` objects no longer have an attached `module` attribute. This also changes the testing matrix to include version `~=8.0`, but maintains `~=7.0` as a separate testing environment. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Munir Abdinur <[email protected]> (cherry picked from commit 78d5b98)
Backport 78d5b98 from #8357 to 2.6. Addresses #8220 and fixes an issue with `pytest` `8.x` and above (brought by pytest-dev/pytest#11137 ) where `pytest.Package` objects no longer have an attached `module` attribute. This also changes the testing matrix to include version `~=8.0`, but maintains `~=7.0` as a separate testing environment. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Romain Komorn <[email protected]>
Looks like this landed in main and in 2.6. Could someone cut a release for 2.6? |
As I mentioned in #8357 (comment) , I ended up merging a short-term fix that addresses the reproducible crashes I could find. For this repo, over the past 24 hours, we've had 235 successful test sessions where the @tamird , let me see when we can get |
Backport 78d5b98 from #8357 to 2.5. Addresses #8220 and fixes an issue with `pytest` `8.x` and above (brought by pytest-dev/pytest#11137 ) where `pytest.Package` objects no longer have an attached `module` attribute. This also changes the testing matrix to include version `~=8.0`, but maintains `~=7.0` as a separate testing environment. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Federico Mon <[email protected]>
Thanks for the fix @romainkomorndatadog. Our test suite is now all green with ddtrace 2.6.4 and pytest 8.0.1. |
@tamird , I just released 2.6.4 and it passes the reproducer test. (I wrote this hours ago and didn't hit the Comment button...) @iherasymenko , thanks for confirming (and thanks again for the repro case :) ). |
Backport 78d5b98 from #8357 to 2.4. Addresses #8220 and fixes an issue with `pytest` `8.x` and above (brought by pytest-dev/pytest#11137 ) where `pytest.Package` objects no longer have an attached `module` attribute. This also changes the testing matrix to include version `~=8.0`, but maintains `~=7.0` as a separate testing environment. ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Federico Mon <[email protected]>
I didnt have a way to create a reproduction like @iherasymenko , sorry about that but can confirm that it's working now using 2.6.4 with pytest 8.0.1 also. thanks! |
DDTrace is incompatible with pytest 8
Which version of dd-trace-py are you using?
2.5.1
Which version of pip are you using?
23.0.1
Which libraries and their versions are you using?
pytest 8.0.0
How can we reproduce your problem?
Run pytest with ddtrace and pytest 8
What is the result that you get?
What is the result that you expected?
My tests run without crashing
The text was updated successfully, but these errors were encountered: