Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Dec 10, 2022

As a follow up after #28047, this PR will make the test cleanup more robust and resilient to any errors that might have caused kubernetes_executors left behind.

wrapping start()/end() in try/finally will make the tests completely resilient to cases where the asserts start to fail - without those, any failure in tests would cause the same resource leakage as we initially had when #28407 was iterated on.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added the area:Scheduler including HA (high availability) scheduler label Dec 10, 2022
@potiuk potiuk requested review from XD-DENG and dstandish December 10, 2022 08:59
@potiuk potiuk changed the title More robust cleanup of executors in kubernetes_tes_executor More robust cleanup of executors in kubernetes_test_executor Dec 10, 2022
@potiuk potiuk force-pushed the robust-resource-cleanup-in-test-k8s-executor branch from fe81e8d to 55cb029 Compare December 10, 2022 14:19
@potiuk
Copy link
Member Author

potiuk commented Dec 10, 2022

BTW. I found one case where the test did not have "task_done()" run because of mocking and that would even stop K8S executor from being killed. should be fixed now.

@potiuk potiuk requested a review from uranusjr December 10, 2022 14:32
@potiuk potiuk changed the title More robust cleanup of executors in kubernetes_test_executor More robust cleanup of executors in test_kubernetes_executor Dec 10, 2022
As a follow up after apache#28047, this PR will make the test cleanup
more robust and resilient to any errors that might have caused
kubernetes_executors left behind.

wrapping start()/end() in try/finally will make the tests
completely resilient to cases where the asserts start to fail -
without those, any failure in tests would cause the same resource
leakage as we initially had when #28407 was iterated on.
@potiuk potiuk force-pushed the robust-resource-cleanup-in-test-k8s-executor branch from 55cb029 to ecc6e9c Compare December 10, 2022 14:33
Copy link
Member

@XD-DENG XD-DENG left a comment

Choose a reason for hiding this comment

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

Thanks @potiuk !

@potiuk potiuk merged commit 3b203bc into apache:main Dec 10, 2022
@potiuk potiuk deleted the robust-resource-cleanup-in-test-k8s-executor branch December 10, 2022 16:09
@pierrejeambrun pierrejeambrun added this to the Airflow 2.5.2 milestone Mar 6, 2023
@pierrejeambrun pierrejeambrun added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Mar 6, 2023
pierrejeambrun pushed a commit that referenced this pull request Mar 6, 2023
As a follow up after #28047, this PR will make the test cleanup
more robust and resilient to any errors that might have caused
kubernetes_executors left behind.

wrapping start()/end() in try/finally will make the tests
completely resilient to cases where the asserts start to fail -
without those, any failure in tests would cause the same resource
leakage as we initially had when #28407 was iterated on.

(cherry picked from commit 3b203bc)
pierrejeambrun pushed a commit that referenced this pull request Mar 8, 2023
As a follow up after #28047, this PR will make the test cleanup
more robust and resilient to any errors that might have caused
kubernetes_executors left behind.

wrapping start()/end() in try/finally will make the tests
completely resilient to cases where the asserts start to fail -
without those, any failure in tests would cause the same resource
leakage as we initially had when #28407 was iterated on.

(cherry picked from commit 3b203bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants