Skip to content

Add --external-postgres to killbench.py and run its smoke mode weekly - #159

Merged
PhiLily merged 1 commit into
mainfrom
feature/weekly-kill-smoke
Oct 28, 2026
Merged

PhiLily merged 1 commit into
mainfrom
feature/weekly-kill-smoke

Conversation

@PhiLily

@PhiLily PhiLily commented Oct 28, 2026

Copy link
Copy Markdown
Member

benchmarks/killbench.py gains --external-postgres. Without it,
orchestrate() calls bench.ensure_docker() and bench.ensure_container(),
which manage a local Docker Desktop container through docker --context desktop-linux, and a GitHub Actions runner has neither that context nor
a docker binary. The flag skips exactly those two calls. The rest of the
setup, ensure_databases(), migrate(), truncate() and
collect_environment(), goes through plain psycopg or Django and works
against any PostgreSQL reachable at bench.PG (127.0.0.1:54330, user
postgres, password ox), the values benchsite/settings_ox.py and its
kill-test derivatives already hard-code, so a service container that
publishes that port needs no settings change. Without the flag the
harness runs exactly as before.

.github/workflows/kill-smoke.yml is new. Its smoke job starts a
postgres:16 service container on port 54330, installs the checked-out
package with Django~=6.1.0 and django-tasks-db==0.13.0, and runs
killbench.py --smoke --external-postgres. django-tasks-db is in no
dependency group: the harness's tasksdb arm imports it directly, and the
explicit pin keeps an upstream db_worker flag change from failing this
job without a deliberate bump here. A second step reads the
results-kill-*-SMOKE.json the harness writes and fails the job if either
arm's harness_ok_all is false, or if in the django-ox arm any task never
reached a terminal state or ended FAILED or LOST. Those three counts are
not checked for the tasks-db arm: it leaves RUNNING rows behind by
design, as the README's "Worker death" disclosures record, so a check
over both arms could never pass. Results and worker logs upload as an
artifact whether the job passes or fails, matched by glob, so the
harness's own -SMOKE filename suffix is kept.

The job runs on a weekly schedule, Wednesday 05:00 UTC ("0 5 * * 3"),
clear of this repository's other two schedules at 03:17 daily and 06:00
on Mondays; on workflow_dispatch; and on a pull request that touches
what the job depends on: the workflow file itself, killbench.py,
bench.py and benchsite/**. The job reads no github.event.pull_request.*
or other pull-request-only expression, so a green run means the same
thing under any of the three triggers.

benchmarks/README.md: the opening line of the "Worker death" section
said the harness reuses bench.py for the container; it now says so for
the default path only and names --external-postgres for the other one.
A new bullet in that section's disclosure list names the weekly workflow
and states that a failing scheduled run reaches only whoever last
committed to the workflow file; nothing else in this repository watches
it. A new "Reproduce this yourself" subsection gives the commands for
the smoke run and the full run, where each writes its output, and how to
submit a run from another host: attach the JSON to an issue or pull
request here.

Nothing in django-ox itself changes, only how its worker-death harness
is exercised and reported on. benchmarks/ is not shipped in the package,
sits outside the ruff and mypy configuration, and gets no CHANGELOG
entry.

Closes #145

benchmarks/killbench.py gains --external-postgres. Without it,
orchestrate() calls bench.ensure_docker() and bench.ensure_container(),
which manage a local Docker Desktop container through `docker --context
desktop-linux`, and a GitHub Actions runner has neither that context nor
a docker binary. The flag skips exactly those two calls. The rest of the
setup, ensure_databases(), migrate(), truncate() and
collect_environment(), goes through plain psycopg or Django and works
against any PostgreSQL reachable at bench.PG (127.0.0.1:54330, user
postgres, password ox), the values benchsite/settings_ox.py and its
kill-test derivatives already hard-code, so a service container that
publishes that port needs no settings change. Without the flag the
harness runs exactly as before.

.github/workflows/kill-smoke.yml is new. Its smoke job starts a
postgres:16 service container on port 54330, installs the checked-out
package with Django~=6.1.0 and django-tasks-db==0.13.0, and runs
killbench.py --smoke --external-postgres. django-tasks-db is in no
dependency group: the harness's tasksdb arm imports it directly, and the
explicit pin keeps an upstream db_worker flag change from failing this
job without a deliberate bump here. A second step reads the
results-kill-*-SMOKE.json the harness writes and fails the job if either
arm's harness_ok_all is false, or if in the django-ox arm any task never
reached a terminal state or ended FAILED or LOST. Those three counts are
not checked for the tasks-db arm: it leaves RUNNING rows behind by
design, as the README's "Worker death" disclosures record, so a check
over both arms could never pass. Results and worker logs upload as an
artifact whether the job passes or fails, matched by glob, so the
harness's own -SMOKE filename suffix is kept.

The job runs on a weekly schedule, Wednesday 05:00 UTC ("0 5 * * 3"),
clear of this repository's other two schedules at 03:17 daily and 06:00
on Mondays; on workflow_dispatch; and on a pull request that touches
what the job depends on: the workflow file itself, killbench.py,
bench.py and benchsite/**. The job reads no github.event.pull_request.*
or other pull-request-only expression, so a green run means the same
thing under any of the three triggers.

benchmarks/README.md: the opening line of the "Worker death" section
said the harness reuses bench.py for the container; it now says so for
the default path only and names --external-postgres for the other one.
A new bullet in that section's disclosure list names the weekly workflow
and states that a failing scheduled run reaches only whoever last
committed to the workflow file; nothing else in this repository watches
it. A new "Reproduce this yourself" subsection gives the commands for
the smoke run and the full run, where each writes its output, and how to
submit a run from another host: attach the JSON to an issue or pull
request here.

Nothing in django-ox itself changes, only how its worker-death harness
is exercised and reported on. benchmarks/ is not shipped in the package,
sits outside the ruff and mypy configuration, and gets no CHANGELOG
entry.

Closes #145
@PhiLily
PhiLily merged commit 511a8ff into main Oct 28, 2026
59 checks passed
@PhiLily
PhiLily deleted the feature/weekly-kill-smoke branch October 28, 2026 15:50
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.

Run the kill-test smoke harness weekly on current main

1 participant