Skip to content

airflowctl: fix flaky xcom add test by using unique keys per test run#63832

Merged
bugraoz93 merged 1 commit intoapache:mainfrom
Dev-iL:fix-flaky-xcom-test
Mar 17, 2026
Merged

airflowctl: fix flaky xcom add test by using unique keys per test run#63832
bugraoz93 merged 1 commit intoapache:mainfrom
Dev-iL:fix-flaky-xcom-test

Conversation

@Dev-iL
Copy link
Copy Markdown
Collaborator

@Dev-iL Dev-iL commented Mar 17, 2026

  • Fix flaky test_airflowctl_commands[xcom add] test that intermittently fails with The XCom with key: 'test_xcom_key' with mentioned task instance already exists.
  • The hardcoded test_xcom_key could collide with leftover state from a previous failed run where xcom delete never executed (e.g., CI timeout or earlier test failure)
  • Derive a unique xcom key per parametrize set from the already-randomized date_param, so both the debug-mode and skip-keyring test sets use distinct keys
  • Add a regression test (test_hardcoded_xcom_key_would_collide) that demonstrates the old hardcoded key produces identical commands across sets while the derived keys always differ.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 4.6 following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom
delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
@Dev-iL Dev-iL requested review from dheerajturaga and removed request for dheerajturaga March 17, 2026 15:17
@Dev-iL Dev-iL mentioned this pull request Mar 17, 2026
6 tasks
@bugraoz93 bugraoz93 merged commit e17ca63 into apache:main Mar 17, 2026
81 checks passed
@Dev-iL Dev-iL deleted the fix-flaky-xcom-test branch March 17, 2026 21:18
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Mar 18, 2026
…apache#63832)

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Mar 18, 2026
…apache#63832)

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
fat-catTW pushed a commit to fat-catTW/airflow that referenced this pull request Mar 22, 2026
…apache#63832)

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
techcodie pushed a commit to techcodie/airflow that referenced this pull request Mar 23, 2026
…apache#63832)

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
abhijeets25012-tech pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Apr 9, 2026
…apache#63832)

The xcom add test used a hardcoded key (`test_xcom_key`) which could collide with leftover state from a previous failed run where xcom delete never executed. Derive the key from the randomized `date_param` so each parametrize set gets a unique key.
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