From a0912b057e25cfc50db2bb8e9ca957daa27f7a5d Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 10 Jun 2021 23:17:49 -0400 Subject: [PATCH] Improve testdatabase performance --- tests/TestDatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/TestDatabase.cpp b/tests/TestDatabase.cpp index b095f4e10..82b0c790d 100644 --- a/tests/TestDatabase.cpp +++ b/tests/TestDatabase.cpp @@ -23,6 +23,7 @@ #include "config-keepassx-tests.h" #include "core/Metadata.h" +#include "core/Tools.h" #include "crypto/Crypto.h" #include "format/KeePass2Writer.h" #include "keys/PasswordKey.h" @@ -118,6 +119,9 @@ void TestDatabase::testSignals() QVERIFY(db->save(&error)); QCOMPARE(spySaved.count(), 1); + // Short delay to allow file system settling to reduce test failures + Tools::wait(100); + QSignalSpy spyFileChanged(db.data(), SIGNAL(databaseFileChanged())); QVERIFY(tempFile.copyFromFile(dbFileName)); QTRY_COMPARE(spyFileChanged.count(), 1);