From d7a9d49c921951150cfe9d0a3eddeec8b8b52a6c Mon Sep 17 00:00:00 2001 From: silverqx Date: Sun, 4 Aug 2024 16:06:48 +0200 Subject: [PATCH] =?UTF-8?q?tests=20bugfix=20tst=5FSoftDeletes=20?= =?UTF-8?q?=F0=9F=99=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/orm/tiny/softdeletes/tst_softdeletes.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/functional/orm/tiny/softdeletes/tst_softdeletes.cpp b/tests/auto/functional/orm/tiny/softdeletes/tst_softdeletes.cpp index 225144fa9..0430f68e8 100644 --- a/tests/auto/functional/orm/tiny/softdeletes/tst_softdeletes.cpp +++ b/tests/auto/functional/orm/tiny/softdeletes/tst_softdeletes.cpp @@ -778,7 +778,11 @@ void tst_SoftDeletes::restore_NotTrashed_OnTinyBuilder() const auto [affected, query] = User::withTrashed()->whereBetween(ID, {4, 5}).restore(); QVERIFY(query.isActive() && !query.isSelect() && !query.isValid()); - QCOMPARE(affected, static_cast(0)); + /* Longstanding bug, OK, the problem was here, sometimes can happen that + the restore() method call above isn't fast enough and this restore also + updates the updated_at column, so even if the deleted_at column isn't updated + as it's NULL (static_cast(0)), so the updated_at column is updated. */ + QVERIFY(affected == static_cast(0) || affected == static_cast(2)); } // Validate user records in the database after the restore