Skip to content

Conversation

@SameerMesiah97
Copy link
Contributor

Description

This change improves the clarity and intent of find_spark_job and its tests:

  • Made the comments and docstring for find_spark_job more explicit about pod selection and prioritization rules.
  • Repurposed test_find_spark_job_picks_running_pod to assert that only non-terminating pods are eligible for selection.
  • Tightened test_find_spark_job_picks_pending_pod to validate phase-based selection only, without relying on deletion_timestamp.
  • Simplified test_find_spark_job_picks_succeeded by removing terminating pods and focusing solely on phase ordering.
  • Simplified test_find_spark_job_picks_latest_pod by neutralizing pod phases to isolate creation timestamp–based selection.

Rationale

find_spark_job implements subtle but critical logic used during restarts and retries.

This cleanup reduces ambiguity, documents intent directly in tests, and makes the selection logic easier to maintain and review while preserving existing semantics.

Tighten comments, docstrings, and tests to make pod prioritization rules explicit.
@jscheffl jscheffl merged commit 1b1bdc9 into apache:main Feb 8, 2026
199 of 200 checks passed
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
Tighten comments, docstrings, and tests to make pod prioritization rules explicit.

Co-authored-by: Sameer Mesiah <smesiah971@gmail.com>
suii2210 pushed a commit to suii2210/airflow that referenced this pull request Feb 9, 2026
Tighten comments, docstrings, and tests to make pod prioritization rules explicit.

Co-authored-by: Sameer Mesiah <smesiah971@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants