AggregatorUpdateItemsTest::testUpdateHookN is failing

Created on 8 December 2023, about 1 year ago
Updated 9 December 2023, about 1 year ago
Drupal\Tests\aggregator\Functional\Update\AggregatorUpdateItemsTest::testUpdateHookN
Error: Call to a member function uuid() on null
/builds/project/aggregator/tests/src/Functional/Update/AggregatorUpdateItemsTest.php:34
/builds/project/aggregator/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

This first started happening while I was working on 📌 Fix gitlab and test next major Needs review . But the failure happens on the unpatched 2.x branch, both locally and in GitLab CI. So it isn't a result of the changes being made to fix phpstan issues.

All of the tests passed after the last commit to 2.x. So it's weird that this is happening. I don't know why yet.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States dcam

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

Merge Requests

Comments & Activities

  • Issue created by @dcam
  • Assigned to abhishek_virasat
  • Merge request !12fix the uuid is null → (Merged) created by abhishek_virasat
  • 🇺🇸United States dcam

    I've been trying to debug this. I wasn't coming up with any answers until I decided to try to load all Items in the test, just to see what would happen. The result was that the test Item was gone, but thirty new and unexpected items had been downloaded from Drupal Planet, the URL of the test feed. So that immediately told me what's going on: the feed is being updated at some point during the update process. But the test item in the fixture has recently passed the expiry time, so it gets deleted by the default parser during the update.

    Probably the update has always been happening, but we never knew because we didn't care to check if any additional items are being created in these update tests. But this is actually a bit of a problem. If all the update tests are requesting Drupal Planet, then that means the tests are wasting time waiting for responses and then parsing the results. So I want to stop it entirely just on principle, if possible. I haven't put effort into tracking down where this is happening yet. I just wanted to record my current findings. My guess is that cron is being executed during the updates.

  • 🇺🇸United States dcam

    If the cron run can't be stopped, then my backup plan is to set the expiry time to unlimited in the fixture. But I'd rather not.

  • Issue was unassigned.
  • 🇺🇸United States dcam

    @abhishek_virasat I'm going to credit you on this because I think your change is worthwhile, but please look into Drupal's PHP Coding Standards .

    Also, I'm a believer that comments should explain "why," not "what." So I removed them because I think that code is pretty obvious. Even the comment that was there before was an error. I probably copied it from somewhere else and forgot to delete it.

    • dcam committed 84a77797 on 2.x
      git commit -m 'Issue #3406943 by dcam, abhishek_virasat:...
  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States dcam

    For the record, I got bitten by #3200500: Strongly discourage clicking Merge on GitLab pages (or make it work) because I didn't know what I was doing when merging the MR. I had to revert that commit, then revert again in order to apply a proper commit message.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024