diff --git a/lib/dml/tests/dml_test.php b/lib/dml/tests/dml_test.php
index <HASH>..<HASH> 100644
--- a/lib/dml/tests/dml_test.php
+++ b/lib/dml/tests/dml_test.php
@@ -4176,6 +4176,7 @@ class dml_testcase extends database_driver_testcase {
                 $t->allow_commit();
                 $j++;
             }
+            $rs2->close();
             $this->assertEquals(4, $j);
         }
         $rs1->close();
MDL-<I> add missing rs close

Thanks Eloy!