Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
- Coverage 73.19% 67.58% -5.62%
==========================================
Files 58 62 +4
Lines 3193 3754 +561
==========================================
+ Hits 2337 2537 +200
- Misses 856 1217 +361
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
API plugin settings (host, port, debug, allow_origin) are now overridden if the corresponding CLI flags are explicitly provided, even when an Api instance is defined outside the default behaviour.
|
Hi! I saw that you mentioned django-tasks compatibility on this PR but couldn't find any reference about it on the code. Do you mind committing those changes or maybe open a new PR with it (to avoid getting this one so large). I was playing around with chancy and also have a semi-functional implementation and it would be nice to see how you managed some issues I've been encountering. Great project btw! |
Respect CLI flags for API plugin configuration
|
@TkTech We just started leveraging chancy and super excited for this new dashboard! Any outstanding items you're looking for help with? |
It's been running for testing in a production environment since Monday, so I'd say we'll release this weekend if all goes well. |
I've left some comments in the #82 ticket regarding this, there are some behavioral Qs to answer before we commit to anything. |
We had partially transitioned to UUIDs in v0.25, this completes the work and adds a regression test and closes #84. Also adds some Executor utilities to the public API for getting and iterating the current job pool.
…g test in the test_scale regression catcher.
…pports cancellation.
…mance of two slow tests.
…efix we found along the way.
UUID-Everywhere
… it's being shutdown causing noisy errors (#62)
…end to let the process die and restart if you can, but this does work.
…e executor picking up the job and registering its PID.
…t a generous timeout.
There was a problem hiding this comment.
Pull request overview
This PR is part of the v0.26.0 major release and, in the areas reviewed here, focuses on improving CI reliability and adding/adjusting test coverage for worker resilience, executor cancellation behavior, trigger isolation under parallel runs, and Django integration.
Changes:
- Reduced test flakiness by replacing fixed sleeps with condition-based waits and loosening overly strict timing assertions in scale/perf tests.
- Added targeted tests for worker backoff bounds and heartbeat recovery from transient database errors.
- Added Django “Tasks backend” integration tests and improved test isolation (prefix/suffix) for parallel runs.
Reviewed changes
Copilot reviewed 113 out of 125 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_worker.py |
Replaces fixed sleeps with polling timeouts; adds backoff/heartbeat resilience tests. |
tests/test_scale.py |
Adjusts fetch timing thresholds to reduce CI noise while still catching regressions. |
tests/test_jobs.py |
Refactors cancellation coverage into executor-specific tests and waits for cancellation completion. |
tests/plugins/test_trigger.py |
Makes trigger tests xdist-safe via per-worker schema/table names and updates assertions/cleanup. |
tests/contrib/django/test_models.py |
Skips ORM model tests under xdist due to static table naming at import time. |
tests/contrib/django/test_django_tasks.py |
Adds Django Tasks backend integration tests (conditional on Django version). |
tests/contrib/django/test_connection.py |
Uses a worker-specific prefix for test isolation. |
tests/contrib/django/settings.py |
Expands Django test settings (secret key, contenttypes, DB config, timezone). |
chancy/executors/process.py |
Updates process executor cancellation/timeout handling used by the new cancellation tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| settings.TASKS = { | ||
| "default": { | ||
| "BACKEND": "chancy.contrib.django.backend.ChancyBackend", | ||
| "QUEUES": ["default", "async_queue"], | ||
| "OPTIONS": { | ||
| "dsn": "postgresql://postgres:localtest@localhost:8190/postgres", | ||
| "prefix": chancy.prefix, | ||
| }, |
| executor = worker._executors.get("cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
| executor = worker._executors.get("async_cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
| settings.TASKS = { | ||
| "default": { | ||
| "BACKEND": "chancy.contrib.django.backend.ChancyBackend", | ||
| "QUEUES": ["default", "async_queue"], | ||
| "OPTIONS": { | ||
| "dsn": "postgresql://postgres:localtest@localhost:8190/postgres", | ||
| "prefix": chancy.prefix, | ||
| }, |
| executor = worker._executors.get("cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
| executor = worker._executors.get("async_cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
| async def _handle_timeout(self, job_id: UUID, time_limit: int): | ||
| try: | ||
| await asyncio.sleep(time_limit) | ||
| pid = self.pids_for_job.get(job_id) |
| settings.TASKS = { | ||
| "default": { | ||
| "BACKEND": "chancy.contrib.django.backend.ChancyBackend", | ||
| "QUEUES": ["default", "async_queue"], | ||
| "OPTIONS": { | ||
| "dsn": "postgresql://postgres:localtest@localhost:8190/postgres", | ||
| "prefix": chancy.prefix, | ||
| }, |
| executor = worker._executors.get("cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
| executor = worker._executors.get("async_cancel_test") | ||
| async with asyncio.timeout(10): | ||
| while executor.is_job_running(ref): | ||
| await asyncio.sleep(0.1) |
…n and add a regression test.
…utate Django's own copy (whoops!)
…lso go through Worker.stop() to attempt to drain the executors.
…multiple different chancy's were somehow already run on the same table.
…ission errors. Enable NPM caching.

(This is a huge release, changelog to come. WIP)
0.26.0
✨ Improvements
push()in a loop instead of a singlepush_many())🐛 Fixes