From ebb7e7d2dc083d5fea4b0a2cedf5ab34fc397a27 Mon Sep 17 00:00:00 2001 From: Alexander Kozlovsky Date: Mon, 16 Oct 2023 11:46:49 +0200 Subject: [PATCH] Fix flaky test_patched_db_session --- src/tribler/core/utilities/tests/test_pony_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tribler/core/utilities/tests/test_pony_utils.py b/src/tribler/core/utilities/tests/test_pony_utils.py index 7a2b540c94b..45751b853ac 100644 --- a/src/tribler/core/utilities/tests/test_pony_utils.py +++ b/src/tribler/core/utilities/tests/test_pony_utils.py @@ -1,3 +1,4 @@ +import time from unittest.mock import patch import pytest @@ -56,6 +57,7 @@ class Entity1(db.Entity): def _perform_queries(): for i in range(10): Entity1(a=i) + time.sleep(0.01) db.commit() db.rollback() Entity1.select().fetch()