diff --git a/lib/testing/classes/util.php b/lib/testing/classes/util.php
index 1fa55b985a8..fdb4e4e81ce 100644
--- a/lib/testing/classes/util.php
+++ b/lib/testing/classes/util.php
@@ -948,6 +948,9 @@ abstract class testing_util {
         if (file_exists($tablesupdatedfile)) {
             unlink($tablesupdatedfile);
         }
+
+        // Reset static cache of cli process.
+        self::reset_updated_table_list();
     }
 
     /**