HookCronTest is broken and doesn't test how often status checks will be run

Created on 14 July 2023, over 1 year ago
Updated 19 July 2023, over 1 year ago

Problem/Motivation

in πŸ“Œ For web server dependent unattended updates run the entire life cycle in a separate process that will not be affected by hosting time limits Fixed I was looking at moving \Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testStatusChecksOnAdminPages to a build test.

I realized it testing 2 things

  1. Logic in automatic_updates_cron that we don’t run status checks more than 1x an hour(if cron runs more than 1x hour)
  2. which status check messages show on a page: summaries vs messages, errors vs warning

For 2) it probably doesn’t matter how the status checks are run. So it we could switch this to $this->container->get('automatic_updates.status_checker')->run(); the test could be simplified and could remain and a functional test.

HookCronTest is very broken. We could fix that test and also have it test that cron will not run status check more than 1x an hour. This would allow simplifying testStatusChecksOnAdminPages as described above

Proposed resolution

  1. Fix \Drupal\Tests\automatic_updates\Kernel\HookCronTest see MR comments as to why this broken.
  2. Add test in \Drupal\Tests\automatic_updates\Kernel\HookCronTest that cron does not run readiness check more 1x an hour
  3. Once 2) is done we can simplify \Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testStatusChecksOnAdminPages because won't need to test that if cron runs more than once an hour status checks will not be re-run. This can just run status checker to because it just needs to test what we show not if cron run status checks

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024