Skip to content
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

fix: flaky test #28168

Merged
merged 2 commits into from
Feb 1, 2025
Merged

fix: flaky test #28168

merged 2 commits into from
Feb 1, 2025

Conversation

aspicer
Copy link
Contributor

@aspicer aspicer commented Jan 31, 2025

test is flaky

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR addresses flaky cohort-related tests by improving query handling, validation, and test harness organization across multiple files.

  • Replaced funnel-based approach with direct EventsQueryRunner in /posthog/hogql_queries/hogql_cohort_query.py for more reliable performed_event_multiple queries
  • Added query validation in /ee/clickhouse/models/test/test_cohort.py to verify LIMIT clauses match MAX_SELECT_COHORT_CALCULATION_LIMIT
  • Changed limit_context to LimitContext.COHORT_CALCULATION in /posthog/models/cohort/util.py for more appropriate query handling
  • Added column name validation in /ee/clickhouse/queries/test/test_cohort_query.py to ensure consistent 'id' column output
  • Moved calculate_cohort_hogql_test_harness into TestCohort class for better encapsulation

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@aspicer aspicer enabled auto-merge (squash) January 31, 2025 23:47
@aspicer aspicer merged commit f3d3210 into master Feb 1, 2025
92 checks passed
@aspicer aspicer deleted the aspicer/skip branch February 1, 2025 07:38
thmsobrmlr pushed a commit that referenced this pull request Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants