From 4bdc2539f9fea0f9ac2f15d82eb8bba111f0bc04 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 10 Jun 2021 23:17:49 -0400 Subject: Improve testdatabase performance --- tests/TestDatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/TestDatabase.cpp b/tests/TestDatabase.cpp index c3a3a8c42..8ec4a1bd7 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); -- cgit v1.2.3