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

chore(ci): Start Celery worker as a background process #29371

Merged

Conversation

john-bodley
Copy link
Member

SUMMARY

I've been fighting with inconsistencies between running CI locally and remote. Whilst working on a specific PR the Celery tests would always succeed locally whereas they would fail in a remote setting. The errors were always suppressed, but my hunch was that maybe the Celery worker(s) weren't responsive as queries remained in the pending state.

If I mangled the python_tests.sh script to only run the tests/integration_tests/celery_tests.py tests everything seemed to be fine which indicated that maybe there was a temporal facet to the flakiness of the tests. Reading through the GitHub actions/workflows it seems like we manually background the task (via the &) yet one can actually run Celery in a detached state, which seems more robust.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI. Also verified that the tests on my other PR successfully ran.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Jun 26, 2024
@@ -117,6 +117,20 @@ testdata() {
say "::endgroup::"
}

celery-worker() {
Copy link
Member Author

Choose a reason for hiding this comment

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

DRY.

@john-bodley john-bodley force-pushed the john-bodley--celery-worker-detached branch from 2d6805f to 55feb68 Compare June 26, 2024 04:05
celery \
--app=superset.tasks.celery_app:app \
worker \
--concurrency=2 \
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems clearer than -c 2.

worker \
--concurrency=2 \
--detach \
--optimization=fair
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems clearer than -Ofair.

@john-bodley john-bodley marked this pull request as ready for review June 26, 2024 04:05
@dosubot dosubot bot added the need:tests This PR requires tests label Jun 26, 2024
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.40%. Comparing base (76d897e) to head (55feb68).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29371      +/-   ##
==========================================
+ Coverage   60.48%   70.40%   +9.91%     
==========================================
  Files        1931     1956      +25     
  Lines       76236    78405    +2169     
  Branches     8568     8958     +390     
==========================================
+ Hits        46114    55201    +9087     
+ Misses      28017    21007    -7010     
- Partials     2105     2197      +92     
Flag Coverage Δ
hive 48.90% <ø> (-0.27%) ⬇️
javascript 58.09% <ø> (+0.37%) ⬆️
mysql 77.30% <ø> (?)
postgres 77.40% <ø> (?)
presto 53.50% <ø> (-0.30%) ⬇️
python 83.75% <ø> (+20.26%) ⬆️
sqlite 76.85% <ø> (?)
unit 59.20% <ø> (+1.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@john-bodley john-bodley merged commit 5948dac into apache:master Jun 26, 2024
39 of 62 checks passed
@john-bodley john-bodley deleted the john-bodley--celery-worker-detached branch June 26, 2024 19:10
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels github_actions Pull requests that update GitHub Actions code need:tests This PR requires tests size/M 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants