Skip to content

Test env filter vs picker #84586

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

Closed
wants to merge 3 commits into from
Closed

Test env filter vs picker #84586

wants to merge 3 commits into from

Conversation

ceorourke
Copy link
Member

Another attempt to repro a customer issue where they have 2 rules with the event frequency condition, 1 rule uses the environment dropdown and the other uses the environment filter. The customer is only seeing one fire instead of both, but I can't reproduce it.

Comment on lines +497 to +418
# self.patcher = patch("sentry.rules.processing.delayed_processing.passes_comparison")
# self.mock_passes_comparison = self.patcher.start()

# def tearDown(self):
# self.patcher.stop()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I commented this stuff out so that my test actually goes through passes_comparison instead of mocking the result

@ceorourke
Copy link
Member Author

env_picker_rule passes the environment ID to the query to see how many events there were in the given time period for that environment https://github.com/getsentry/sentry/blob/master/src/sentry/rules/processing/delayed_processing.py#L355 whereas env_filter_rule does not, but the filter is evaluated separately (and earlier) to the number of events (in all environments).

Copy link

codecov bot commented Feb 5, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
24712 4 24708 296
View the top 3 failed test(s) by shortest run time
tests.sentry.rules.processing.test_delayed_processing.GetRulesToFireTest::test_comparison_any
Stack Traces | 1.09s run time
#x1B[1m#x1B[.../rules/processing/test_delayed_processing.py#x1B[0m:550: in test_comparison_any
    self.mock_passes_comparison.return_value = True
#x1B[1m#x1B[31mE   AttributeError: 'GetRulesToFireTest' object has no attribute 'mock_passes_comparison'#x1B[0m
tests.sentry.rules.processing.test_delayed_processing.GetRulesToFireTest::test_comparison_any_fail
Stack Traces | 1.13s run time
#x1B[1m#x1B[.../rules/processing/test_delayed_processing.py#x1B[0m:563: in test_comparison_any_fail
    self.mock_passes_comparison.return_value = False
#x1B[1m#x1B[31mE   AttributeError: 'GetRulesToFireTest' object has no attribute 'mock_passes_comparison'#x1B[0m
tests.sentry.rules.processing.test_delayed_processing.GetRulesToFireTest::test_comparison
Stack Traces | 1.23s run time
#x1B[1m#x1B[.../rules/processing/test_delayed_processing.py#x1B[0m:525: in test_comparison
    self.mock_passes_comparison.return_value = True
#x1B[1m#x1B[31mE   AttributeError: 'GetRulesToFireTest' object has no attribute 'mock_passes_comparison'#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ceorourke ceorourke closed this Apr 22, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant