-
Notifications
You must be signed in to change notification settings - Fork 544
fix: Handle invalid SENTRY_DEBUG
values properly
#4400
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
Merged
szokeasaurusrex
merged 4 commits into
master
from
szokeasaurusrex/consistent-env-var-handling
May 20, 2025
Merged
fix: Handle invalid SENTRY_DEBUG
values properly
#4400
szokeasaurusrex
merged 4 commits into
master
from
szokeasaurusrex/consistent-env-var-handling
May 20, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit enables the `keep_alive` option to be set via the `SENTRY_KEEP_ALIVE` environment variable. When both the environment variable and the argument are provided, the argument takes precedence. Closes #4354
Previously, if the environment variable `SENTRY_DEBUG` would have an invalid value, such as "invalid," we would set `rv["debug"]` to `None`. However, since this value should be a boolean, it should instead be set to `False`. This change ensures that `rv["debug"]` always is a boolean. Where we previously would have set the value to `None`, we now set it to `False`. Other behavior remains unchanged. Ref https://github.com/getsentry/sentry-python/pull/4366/files#r2075294825
|
Tests completed | Failed | Passed | Skipped |
---|---|---|---|
24017 | 5 | 24012 | 5866 |
View the top 3 failed test(s) by shortest run time
tests.integrations.redis.cluster.test_redis_cluster::test_rediscluster_pipeline[False-expected_first_ten0]
Stack Traces | 0.088s run time
.../redis/cluster/test_redis_cluster.py:131: in test_rediscluster_pipeline assert span["data"] == ApproxDict( E assert {'thread.id': '140210012343168', 'thread.name': 'MainThread', 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379, 'redis.commands': {'count': 0, 'first_ten': []}} == {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]}, 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Common items: E {'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Differing items: E {'redis.commands': {'count': 0, 'first_ten': []}} != {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]}} E Left contains 2 more items: E {'thread.id': '140210012343168', 'thread.name': 'MainThread'} E Full diff: E { E 'db.system': 'redis', E - 'redis.commands': {'count': 3, E ? ^ E + 'redis.commands': {'count': 0, E ? ^ E - 'first_ten': ["GET 'foo'", E ? ^^^^^^^^^^^ E + 'first_ten': []}, E ? ^^ E - "SET 'bar' [Filtered]", E - "SET 'baz' [Filtered]"]}, E 'server.address': '127.0.0.1', E 'server.port': 6379, E + 'thread.id': '140210012343168', E + 'thread.name': 'MainThread', E }
tests.integrations.redis.cluster.test_redis_cluster::test_rediscluster_pipeline[True-expected_first_ten1]
Stack Traces | 0.088s run time
.../redis/cluster/test_redis_cluster.py:131: in test_rediscluster_pipeline assert span["data"] == ApproxDict( E assert {'thread.id': '140210012343168', 'thread.name': 'MainThread', 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379, 'redis.commands': {'count': 0, 'first_ten': []}} == {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"]}, 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Common items: E {'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Differing items: E {'redis.commands': {'count': 0, 'first_ten': []}} != {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"]}} E Left contains 2 more items: E {'thread.id': '140210012343168', 'thread.name': 'MainThread'} E Full diff: E { E 'db.system': 'redis', E - 'redis.commands': {'count': 3, E ? ^ E + 'redis.commands': {'count': 0, E ? ^ E - 'first_ten': ["GET 'foo'", E ? ^^^^^^^^^^^ E + 'first_ten': []}, E ? ^^ E - "SET 'bar' 1", E - "SET 'baz' 2"]}, E 'server.address': '127.0.0.1', E 'server.port': 6379, E + 'thread.id': '140210012343168', E + 'thread.name': 'MainThread', E }
tests.integrations.redis.cluster.test_redis_cluster::test_rediscluster_pipeline[False-expected_first_ten0]
Stack Traces | 0.094s run time
.../redis/cluster/test_redis_cluster.py:131: in test_rediscluster_pipeline assert span["data"] == ApproxDict( E assert {'thread.id': '139863045888896', 'thread.name': 'MainThread', 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379, 'redis.commands': {'count': 0, 'first_ten': []}} == {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]}, 'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Common items: E {'db.system': 'redis', 'server.address': '127.0.0.1', 'server.port': 6379} E Differing items: E {'redis.commands': {'count': 0, 'first_ten': []}} != {'redis.commands': {'count': 3, 'first_ten': ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]}} E Left contains 2 more items: E {'thread.id': '139863045888896', 'thread.name': 'MainThread'} E Full diff: E { E 'db.system': 'redis', E - 'redis.commands': {'count': 3, E ? ^ E + 'redis.commands': {'count': 0, E ? ^ E - 'first_ten': ["GET 'foo'", E ? ^^^^^^^^^^^ E + 'first_ten': []}, E ? ^^ E - "SET 'bar' [Filtered]", E - "SET 'baz' [Filtered]"]}, E 'server.address': '127.0.0.1', E 'server.port': 6379, E + 'thread.id': '139863045888896', E + 'thread.name': 'MainThread', E }
To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.
antonpirker
approved these changes
May 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, if the environment variable
SENTRY_DEBUG
would have an invalid value, such as "invalid," we would setrv["debug"]
toNone
. However, since this value should be a boolean, it should instead be set toFalse
.This change ensures that
rv["debug"]
always is a boolean. Where we previously would have set the value toNone
, we now set it toFalse
. Other behavior remains unchanged.Ref https://github.com/getsentry/sentry-python/pull/4366/files#r2075294825
Depends on:
keep_alive
via environment variable #4366