]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - regression-tests.dnsdist/test_CDB.py
Merge pull request #14001 from rgacogne/ddist-ffi-policy-no-server
[thirdparty/pdns.git] / regression-tests.dnsdist / test_CDB.py
index 2ed764ce86b08b7dfb58feee9d75486f278a7ebc..2b4f0a06ad98416272af2bcc58d89da41b074571 100644 (file)
@@ -15,6 +15,7 @@ def writeCDB(fname, variant=1):
     cdb.add(b'this is the value of the qname tag', b'this is the value of the second tag')
     cdb.commit().close()
     os.rename(fname+'.tmp', fname)
+    cdb.close()
 
 @unittest.skipIf('SKIP_CDB_TESTS' in os.environ, 'CDB tests are disabled')
 class CDBTest(DNSDistTest):
@@ -184,6 +185,9 @@ class TestCDBReload(CDBTest):
             self.assertEqual(expectedResponse, receivedResponse)
 
         # write a new CDB which has no entry for 127.0.0.1
+        # first ensure that the mtime will change after writing
+        # the new version
+        time.sleep(1)
         writeCDB(self._cdbFileName, 2)
         # wait long enough for the CDB database to be reloaded
         time.sleep(self._cdbRefreshDelay + 1)