From fc530b1837dae1b1dad02d1be0eecc8c898de05b Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 18 Apr 2021 23:43:13 +0200 Subject: [PATCH] MDL-71367 unit tests: Add missing ->destroy() call to test backups As part of the tests preparations, some backups are created, but the tests aren't calling to their ->destroy() method at the end. The destroy() method is needed to go cleaning and unsetting various objects that, only then, will free resources, like memory, open files... This isn't critical under Unix OSs... but Windows is really sensible and keeps all open files locked, so any write operation on them fails. --- backup/tests/backup_cleanup_task_test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/backup/tests/backup_cleanup_task_test.php b/backup/tests/backup_cleanup_task_test.php index e4b71c8c9d5..98fdbb314fd 100644 --- a/backup/tests/backup_cleanup_task_test.php +++ b/backup/tests/backup_cleanup_task_test.php @@ -60,6 +60,7 @@ class core_backup_cleanup_task_testcase extends advanced_testcase { $user->id ); $controller->execute_plan(); + $controller->destroy(); // Unset all structures, close files... return $controller->get_backupid(); } -- 2.39.2