Moodle
  1. Moodle
  2. MDL-35714

collect garbage after each unit test

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.3.3
    • Component/s: Unit tests
    • Labels:
    • Rank:
      44458

      Description

      The problem is that some code might have destroy actions which would be triggered a lot later.

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          If you can revert MDL-34894 while doing this, it would be awesome, TIA!

          Show
          Eloy Lafuente (stronk7) added a comment - If you can revert MDL-34894 while doing this, it would be awesome, TIA!
          Hide
          Petr Škoda added a comment -

          To integrators: please manually revert commits introduced by MDL-34894 if this gets integrated.

          Show
          Petr Škoda added a comment - To integrators: please manually revert commits introduced by MDL-34894 if this gets integrated.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (23 and master), thanks!

          Also I've reverted the manual call to gc_collect_cycles() introduced by MDL-34894, because now it's called on all tests reset.

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (23 and master), thanks! Also I've reverted the manual call to gc_collect_cycles() introduced by MDL-34894 , because now it's called on all tests reset.
          Hide
          Tim Barker added a comment -

          David, this needs to be tested in a Windows environment, the Linux stuff is tested on the build machines. It will suffice to check the build results for Linux (they pass ).

          Show
          Tim Barker added a comment - David, this needs to be tested in a Windows environment, the Linux stuff is tested on the build machines. It will suffice to check the build results for Linux (they pass ).
          Hide
          David Monllaó added a comment -

          Using Windows 7 with Apache 2.2, PHP 5.3.17, PHPUnit 3.7.7 and Postgres 9.2. I'm getting a single failure, with and without the patch, so I doubt that's caused by this issue, I've asked Matt about the last time phpunit was executed in a Win environment and he don't know anything about it. Some of you have a phpunit env in windows to discard that is due to my environment setup? To set up the environment I've followed http://docs.moodle.org/dev/PHPUnit_installation_in_Windows instructions

          Attaching screenshot

          Show
          David Monllaó added a comment - Using Windows 7 with Apache 2.2, PHP 5.3.17, PHPUnit 3.7.7 and Postgres 9.2. I'm getting a single failure, with and without the patch, so I doubt that's caused by this issue, I've asked Matt about the last time phpunit was executed in a Win environment and he don't know anything about it. Some of you have a phpunit env in windows to discard that is due to my environment setup? To set up the environment I've followed http://docs.moodle.org/dev/PHPUnit_installation_in_Windows instructions Attaching screenshot
          Show
          Matteo Scaramuccia added a comment - FYI: http://docs.moodle.org/dev/Common_unit_test_problems#collatorlib_testcase::test_asort_objects_by_method
          Hide
          David Monllaó added a comment -

          Thanks Matteo, that's exactly what I was looking for. Passing it

          Show
          David Monllaó added a comment - Thanks Matteo, that's exactly what I was looking for. Passing it
          Hide
          Eloy Lafuente (stronk7) added a comment -

          From somewhere within the clouds...

          Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - From somewhere within the clouds... Congrats, this has been sent upstream and is now part of Moodle (your favorite LMS platform). Many thanks for your awesome collaboration! Ciao

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: