Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-80448

Error related to Matrix during PHPUnit execution

XMLWordPrintable

    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • Hide

      CiBot with the latest matrixsynapse_mock Docker image

      Show
      CiBot with the latest matrixsynapse_mock Docker image
    • 2
    • Team Hedgehog 2024 Sprint 3.2

      We've been getting the following error related to Matrix in some PHPUnit builds:

      Console output

      1) core_communication\api_test::test_delete_room
      GuzzleHttp\Exception\ServerException: Server error: `POST http://matrixmock8c310037ae729a66/hash43a9519ed4b5e9c75eb7d683e3d1e09708f9b34a/backoffice/create-admin` resulted in a `500 Internal Server Error` response:
      <!-- App\Entity\Password::setPassword(): Argument #1 ($password) must be of type string, null given, called in /var/www/ (truncated...)
       
       
      /var/www/html/lib/guzzlehttp/guzzle/src/Exception/RequestException.php:113
      /var/www/html/lib/guzzlehttp/guzzle/src/Middleware.php:69
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:204
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:153
      /var/www/html/lib/guzzlehttp/promises/src/TaskQueue.php:48
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:248
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:224
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:269
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:226
      /var/www/html/lib/guzzlehttp/promises/src/Promise.php:62
      /var/www/html/lib/guzzlehttp/guzzle/src/Client.php:187
      /var/www/html/lib/guzzlehttp/guzzle/src/ClientTrait.php:95
      /var/www/html/communication/provider/matrix/tests/matrix_test_helper_trait.php:49
      /var/www/html/communication/provider/matrix/tests/matrix_test_helper_trait.php:107
      /var/www/html/communication/tests/api_test.php:43
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:81
      

      Discussed about this with huongn@moodle.com this is how it works when running matrix related unit tests:

      1. Reset the mock data
      2. Init mock config
      2.1 Create admin user
      2.2 Login as admin user.

      The problem is the 2nd step does not wait for the 1st step to be completed.
      So, if there are some problems at that time (Ex: Server performance), the reset process will take a lot of time to finish, so the create admin-user request will be rejected.

      Looking at the Moodle code, we did not validation the response from the mock strictly and it would be good to make some extra conditions to make it more stable.

            huongn@moodle.com Huong Nguyen
            lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes
                4h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.