-
Bug
-
Resolution: Fixed
-
Blocker
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
Running unit tests under windows there are a lot of failures, all them of the type:
Warning: rmdir(C:\Users\stronk7\moodledata\integration\master\mssql_phpunit/temp): Directory not empty in C:\Users\stronk7\git_moodle\integration\lib\moodlelib.php on line 9064
|
Curiously this does not happen in previous versions, where we have (in an not-ideal way) mitigated it by adding calls to gc_collect_cycles() in tests (MDL-47675).
Then MDL-50063 was created to review all those calls and fix the real problem: we leaving unclosed resources in tests. But it has not been fixed at the time of creating this.
Back to Moodle 3.1... it seems that the new tool_recyclebin is enabled by default and that causes every delete (course or category) operation in tests, to perform a silent backup of the affected courses.
And those backup operations, happening behind the scenes are the ultimate culprit for the windows failures, because every operation leaves at least a .log file opened.
I've confirmed that tool_recyclebin is the cause of the problem because, the same unit tests, running with the tool disabled via cfg end without error.
So this issue is about to ensure that, in core, we always close all files correctly. And we should achieve that by always destroying the controller when a backup/restore operation happens.
Note that such a destroy() destroy operation is optional, and people using custom backup & restore scripts may not be using it. They shouldn't be affected much and, at least, with this solved... they'll have a way to close logger resources properly.
So that's it. Working on this right now...
- blocks
-
MDL-50063 Review gc_collect_cycles() introduced by MDL-47675
-
- Closed
-
-
MDLQA-9733 CLONE - Run PHPUnit tests on MSSQL (sqldriver)
-
- Passed
-
-
MDLQA-9736 CLONE - Run unit test and behat on windows
-
- Passed
-
- has been marked as being related by
-
MDL-54600 Windows PHPUnit errors introduced in 3.0.4 (unclosed files)
-
- Closed
-
- is duplicated by
-
MDL-35712 Ensure all backup & restore operations in core always call to controller->destroy()
-
- Closed
-
- Testing discovered
-
MDL-54561 mod_lti phpunit failure under windows
-
- Closed
-