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 order of returned dag runs #24405

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Jun 12, 2022

There was no ordering on a query returning dag_runs when it comes
to grid view. This caused flaky tests but also it would have
caused problems with random reordering of reported dagruns in the
UI (it seems).

This change adds stable ordering on returned Dag Runs:

  • by dag_run_id (ascending) asc

No need to filter by map_index as there will be always max one
returned TI from each dag run


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragement file, named {pr_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Jun 12, 2022
@potiuk potiuk marked this pull request as ready for review June 12, 2022 22:15
@potiuk potiuk force-pushed the fix-flaky-order-of-dagruns branch from c09f7b3 to 1646f3c Compare June 12, 2022 22:19
There was no ordering on a query returning dag_runs when it comes
to grid view. This caused flaky tests but also it would have
caused problems with random reordering of reported dagruns in the
UI (it seems).

This change adds stable ordering on returned Dag Runs:

* by dag_run_id (ascending) asc

No need to filter by map_index as there will be always max one
returned TI from each dag run
@potiuk potiuk force-pushed the fix-flaky-order-of-dagruns branch from 1646f3c to 57ca704 Compare June 12, 2022 22:20
@potiuk
Copy link
Member Author

potiuk commented Jun 12, 2022

cc: @ashb -> I think you need to take a look, but I am quite certain it was it.

@potiuk potiuk added this to the Airflow 2.3.3 milestone Jun 13, 2022
@potiuk
Copy link
Member Author

potiuk commented Jun 13, 2022

You might want to include @ashb (if not done already) in #24284

@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Jun 13, 2022
@potiuk potiuk merged commit 2edab57 into apache:main Jun 13, 2022
@potiuk potiuk deleted the fix-flaky-order-of-dagruns branch June 13, 2022 07:04
ephraimbuddy pushed a commit that referenced this pull request Jun 29, 2022
There was no ordering on a query returning dag_runs when it comes
to grid view. This caused flaky tests but also it would have
caused problems with random reordering of reported dagruns in the
UI (it seems).

This change adds stable ordering on returned Dag Runs:

* by dag_run_id (ascending) asc

No need to filter by map_index as there will be always max one
returned TI from each dag run

(cherry picked from commit 2edab57)
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Jun 30, 2022
@ephraimbuddy ephraimbuddy added type:bug-fix Changelog: Bug Fixes changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) and removed type:misc/internal Changelog: Misc changes that should appear in change log type:bug-fix Changelog: Bug Fixes changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues okay to merge It's ok to merge this PR as it does not require more tests type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants