wrolpi/.github/workflows/controller-tests.yml
Roland 9d24d67f59
ci: raise the test timeout to 120s, and run controller tests on pull requests
The first CI run that actually enforced the timeout failed sixteen tests, and not
one of them had hung.  Every failure sat at exactly 30.0s, and the successes
directly beneath them tell the story: test_get_refresh_progress passed at 29.9s,
test_create_playlist at 29.8s, test_configs_crud at 29.4s.  A cluster of
refresh/worker tests straddles the limit on CircleCI's 4 vCPU box, which runs this
suite in about twice the wall-clock of a dev machine -- the ones that passed did so
by a tenth of a second, which is luck, not headroom.  Thirty seconds was never a
viable limit there; it only looked fine locally because nothing local exceeds it.

So the limit is a hang detector, not a performance budget.  120s is roughly four
times the slowest legitimate test observed on CI: still short enough to name a
hung test long before CircleCI kills the job, and long enough to leave
slow-but-working tests alone.  A limit that fires on healthy tests only trades one
unreliable signal for another.

Also: controller-tests.yml carried the same `pull_request: branches: [master]`
filter that jest-tests.yml did, so it never ran on a pull request into any other
branch.  That is why Controller Tests is missing from the checks on the very pull
request that moved it to Python 3.13 -- the change could not be verified by the run
containing it.  Now unfiltered, like jest-tests.

Not verified locally: this machine is under a load average of 45 from unrelated
work, so the suite takes more than four times its usual wall-clock here and any
timing measurement is meaningless.  The change is strictly more permissive than
what already passed at 30s, so it cannot introduce a failure, and CI is the
environment in question -- it decides this one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 18:05:44 -06:00

36 lines
1.1 KiB
YAML

name: Controller Tests
# `pull_request` is unfiltered for the same reason as jest-tests.yml: `branches: [master]` meant
# this never ran on a pull request into any other branch. It is why Controller Tests is absent
# from the checks on the pull request that moved this job to Python 3.13 -- the change to this
# file could not be verified by the run that contained it.
on:
push:
branches: [master, feature/*]
pull_request:
jobs:
controller-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: controller
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
# Trixie ships 3.13, and docker/controller/Dockerfile is python:3.13-slim-trixie.
python-version: '3.13'
cache: 'pip'
cache-dependency-path: controller/requirements.txt
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run pytest
run: python -m pytest test/ -v --tb=short --confcutdir=$(pwd)