Mark Update module tests skipped if run with the built-in PHP server

Created on 15 March 2023, over 1 year ago
Updated 16 March 2023, over 1 year ago

Problem/Motivation

If you run most update module tests with PHP's built-in single-threaded server they will not pass because \Drupal\update_test\Controller\UpdateTestController requires a 2nd connection to return the Update XML fixtures

I am not sure if other module tests might have similar problems

Are core's tests even meant to run using a single thread server.

Proposed resolution

Mark tests skipped if they will not work with a single thread server and the built-in php server is in use

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
UpdateΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @tedbow
  • πŸ‡ΊπŸ‡ΈUnited States @dww
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

  • Issue created by @tedbow
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Thanks for opening this, Ted.

    I asked in #bugsmash in Slack about this, since it seems more like a task to me.. There was general agreement that this isn't a bug:

    What's the point in skipping tests here? I'm guessing the idea is that you run a whole test suite at once, but if some tests are skipped do you just say "eh, good enough"? I guess if it just fails it might not be as obvious as to why it failed and you might waste time debugging the failure.

    - @mstrelan

    It does seem like a task to me.

    We could add an explanation in the docs somewhere, https://www.drupal.org/docs/develop/automated-testing β†’

    - @quietone

    Moving Category to task.

    But sure, if we can't get the tests to tell us anything meaningful with the built-in PHP webserver, no objection to marking them skipped (assuming @mstrelan's point is in the right direction: better to skip than to fail in potentially confusing ways).

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

    @dww thanks for the feedback.

    I am open to not skipping the tests but if we don't I think we should check to see if the built-in in server is being used at the beginning and just fail the test with a good message about why. Currently the tests will fail but it is not clear why because there is not a good message. The request for the XML just doesn't return so difficult to understand why the test failed.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    I do wonder if the scope of this issue needs to be broadened. Are update module tests the only ones that make requests that fail in this way? Seems a little hard to believe. πŸ˜…

    Instead of manually doing weirdness in update module tests for this, can we come up with a more general solution?

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    I had the same thought as #4 and to be honest I haven't looked at the test(s) in question. I wondered if there is an attribute or annotation we can put on these tests, or a trait that they all use, or anything like that.

Production build 0.71.5 2024