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

PHPUnit crashes when running contentbank tests with process isolation

XMLWordPrintable

      $ vendor/bin/phpunit contentbank/tests/contentbank_test.php --filter test_is_context_allowed --process-isolation
      Moodle 4.2beta (Build: 20230414)
      Php: 8.0.28, mysqli: 8.0.32, OS: Linux 5.4.0-146-generic x86_64
      PHPUnit 9.5.27 by Sebastian Bergmann and contributors.
       
      Serialization of 'Closure' is not allowed
      

      The test case never completes, because PHPUnit crashes during the run

      It's related to a "feature" (bug?) within PHPUnit that is described at https://github.com/sebastianbergmann/phpunit/issues/2739 - caused by the following:

      1. Test using a @dataProvider;
      2. @dataProvider returns a closure/callable;
      3. Running with --process-isolation

      Grepping the codebase, it seems we hit this only in contentbank tests (I didn't find any other cases that would trigger it)

        1. (I) Passed -- (400)MDL-77935.png
          76 kB
          Kim Jared Lucas
        2. (I) Passed -- (401)MDL-77935.png
          76 kB
          Kim Jared Lucas
        3. (I) Passed -- (Master)MDL-77935.png
          77 kB
          Kim Jared Lucas

            pholden Paul Holden
            pholden Paul Holden
            Amaia Anabitarte Amaia Anabitarte
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 41 minutes
                1h 41m

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