diff --git a/cardano_node_tests/tests/test_dbsync.py b/cardano_node_tests/tests/test_dbsync.py index 299b72f26..191ea5e32 100644 --- a/cardano_node_tests/tests/test_dbsync.py +++ b/cardano_node_tests/tests/test_dbsync.py @@ -302,19 +302,18 @@ def test_epoch(self, cluster: clusterlib.ClusterLib): common.get_test_id(cluster) current_epoch = cluster.g_query.get_epoch() - epoch = current_epoch - 20 if current_epoch >= 20 else current_epoch blocks_data_blk_count = 0 blocks_data_tx_count = 0 - for b in dbsync_queries.query_blocks(epoch_from=epoch, epoch_to=epoch): + for b in dbsync_queries.query_blocks(epoch_from=current_epoch, epoch_to=current_epoch): blocks_data_blk_count += 1 blocks_data_tx_count += b.tx_count if b.tx_count else 0 epoch_data_blk_count = 0 epoch_data_tx_count = 0 - for e in dbsync_queries.query_epoch(epoch_from=epoch, epoch_to=epoch): + for e in dbsync_queries.query_epoch(epoch_from=current_epoch, epoch_to=current_epoch): epoch_data_blk_count += e.blk_count epoch_data_tx_count += e.tx_count @@ -323,8 +322,10 @@ def test_epoch(self, cluster: clusterlib.ClusterLib): except AssertionError: if blocks_data_blk_count == epoch_data_blk_count + 1: pytest.xfail("Blocks count don't match between tables, see dbsync issue #1363") + elif current_epoch < 3: + pytest.xfail("See cardano-db-sync issue #1377") raise assert ( blocks_data_tx_count == epoch_data_tx_count - ), "Transactions count don't match between tables" + ), f"Transactions count don't match between tables for epoch {current_epoch}"