From 0918da7c083630293a4e1b141e9f97fb05fa3a3b Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 6 Nov 2026 18:14:19 +0100 Subject: [PATCH] fix(tests): defer single-instance singletons Schedule the mempool query and db-sync reconnect singleton tests late when CLUSTERS_COUNT is less than two. Let shared tests finish naturally before these tests request exclusive access to the sole instance. Preserve normal ordering for multi-instance runs without changing priority or acquisition timeouts. Verify collection order with one and two instances; make lint passed. --- cardano_node_tests/tests/test_dbsync.py | 3 +++ cardano_node_tests/tests/test_tx_mempool.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cardano_node_tests/tests/test_dbsync.py b/cardano_node_tests/tests/test_dbsync.py index d5a38e728..3bf1868c5 100644 --- a/cardano_node_tests/tests/test_dbsync.py +++ b/cardano_node_tests/tests/test_dbsync.py @@ -18,6 +18,7 @@ from cardano_node_tests.tests import markers from cardano_node_tests.utils import cluster_nodes from cardano_node_tests.utils import clusterlib_utils +from cardano_node_tests.utils import configuration from cardano_node_tests.utils import dbsync_queries from cardano_node_tests.utils import dbsync_service_manager from cardano_node_tests.utils import dbsync_snapshot_service @@ -345,6 +346,8 @@ def test_cost_model(self, cluster: clusterlib.ClusterLib): ) @allure.link(helpers.get_vcs_link()) + # With one instance, run late so shared tests finish before the exclusive lock is needed. + @pytest.mark.order(-10 if configuration.CLUSTERS_COUNT < 2 else None) @pytest.mark.xdist_split(markers.XdSplits.heavy) @pytest.mark.testnets def test_reconnect_dbsync( diff --git a/cardano_node_tests/tests/test_tx_mempool.py b/cardano_node_tests/tests/test_tx_mempool.py index d1776cb26..d6d6e7c6b 100644 --- a/cardano_node_tests/tests/test_tx_mempool.py +++ b/cardano_node_tests/tests/test_tx_mempool.py @@ -10,6 +10,7 @@ from cardano_node_tests.tests import addrs_common from cardano_node_tests.tests import common from cardano_node_tests.tests import markers +from cardano_node_tests.utils import configuration from cardano_node_tests.utils import helpers LOGGER = logging.getLogger(__name__) @@ -36,6 +37,8 @@ def payment_addrs_locked( return addrs @allure.link(helpers.get_vcs_link()) + # With one instance, run late so shared tests finish before the exclusive lock is needed. + @pytest.mark.order(-10 if configuration.CLUSTERS_COUNT < 2 else None) @pytest.mark.xdist_split(markers.XdSplits.heavy) @pytest.mark.testnets def test_query_mempool_txin(