Skip to content

fix(tests): Fix flaky test_generate_rule_conditions_filters ordering#108914

Draft
joshuarli wants to merge 2 commits intomasterfrom
fix/flaky-test-rule-conditions-ordering
Draft

fix(tests): Fix flaky test_generate_rule_conditions_filters ordering#108914
joshuarli wants to merge 2 commits intomasterfrom
fix/flaky-test-rule-conditions-ordering

Conversation

@joshuarli
Copy link
Member

Summary

  • Use order-independent comparison for conditions and filters lists in test_generate_rule_conditions_filters
  • The conditions.all() DB query order is non-deterministic, causing the == comparison to fail intermittently when conditions come back in a different order
  • Adopts the same comparison pattern used by assert_equal_serializers in the same file

Fixes #108913

Use order-independent comparison for conditions and filters lists since
the DB query order from `conditions.all()` is non-deterministic.

Fixes #108913
@joshuarli
Copy link
Member Author

can these be set-compared instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: tests/sentry/api/serializers/test_rule.py::WorkflowRuleSerializerTest::test_generate_rule_conditions_filters

1 participant