mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-11-18 20:54:26 +00:00
* Fix two races behind flaky tests: favicon cache and a new monitor queued twice - Favicon: get_favicon_filename() could glob before a save and store its "no favicon" after the save cleared the cache, leaving the icon missing until the next save. The lookup and the clearing now share a lock. test_favicon_url_change also lets the new monitor's first check finish before saving a favicon. - Scheduler: its queued/running lists are from the start of a pass, so a monitor a worker had just taken off the queue (not claimed yet) looked idle and was queued again, and that copy was re-queued until the first check finished, so it ran twice (test_fallback_fetchers_chain_in_priority_order saw 2 calls). The ticker now re-checks live before queueing and stamps scheduled_at; a worker drops a scheduled item when the monitor was checked since then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bump licence * Fix two more races from this PR's CI: a new watch's first check before the test (or its config) is ready - tests/util.py wait_for_all_checks(client): an import or API create doesn't queue the watch, the scheduler picks it up on its next pass, so the queue could be empty (and the wait return) before the first check started; the test then changed the page under it. test_nonrenderable_pages failed this way: the first check fetched the "no text" page, so no first snapshot. It now also waits (5s at most) until every unpaused watch was checked. - api/operations create_watch: the processor config was saved after add_watch(), so the scheduler could check the new watch with the processor's defaults first (test_example_wordcounter_processor_plugin counted 7 words, not 5). With processor config it's added paused until the config is saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tests - queue UI: keep workers stopped through the scheduler's health check, and restore them after _quiesce() stops every worker, but the scheduler's worker health check (every 60s, even while paused) restarts them up to FETCH_WORKERS / the workers setting; when it fired during a test they took the sentinel and the test failed with "Could not get queue to a quiescent state". It now expects 0 workers for the test (FETCH_WORKERS and the setting, via monkeypatch). The workers were also never put back, so the next test on that pytest worker ran with none until the health check: an autouse fixture now restores the count they had before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>