diff --git a/tests/integration/test_asynchronous_metrics_pk_bytes_fields/configs/asynchronous_metrics_update_period_s.xml b/tests/integration/test_asynchronous_metrics_pk_bytes_fields/configs/asynchronous_metrics_update_period_s.xml index 47e88730482..0a56d734805 100644 --- a/tests/integration/test_asynchronous_metrics_pk_bytes_fields/configs/asynchronous_metrics_update_period_s.xml +++ b/tests/integration/test_asynchronous_metrics_pk_bytes_fields/configs/asynchronous_metrics_update_period_s.xml @@ -1,3 +1,4 @@ 1 + 1 diff --git a/tests/integration/test_asynchronous_metrics_pk_bytes_fields/test.py b/tests/integration/test_asynchronous_metrics_pk_bytes_fields/test.py index 23123daf805..52beedfe8e8 100644 --- a/tests/integration/test_asynchronous_metrics_pk_bytes_fields/test.py +++ b/tests/integration/test_asynchronous_metrics_pk_bytes_fields/test.py @@ -22,36 +22,30 @@ def started_cluster(): def test_total_pk_bytes_in_memory_fields(started_cluster): - try: - cluster.start() - node1.query("SET log_queries = 1;") - node1.query("CREATE DATABASE replica;") - query_create = """CREATE TABLE replica.test - ( - id Int64, - event_time DateTime - ) - Engine=MergeTree() - PARTITION BY toYYYYMMDD(event_time) - ORDER BY id;""" - time.sleep(2) - node1.query(query_create) - node1.query("""INSERT INTO replica.test VALUES (1, now())""") - node1.query("SYSTEM FLUSH LOGS;") + cluster.start() + node1.query("SET log_queries = 1;") + query_create = """CREATE TABLE test + ( + id Int64, + event_time DateTime + ) + Engine=MergeTree() + PARTITION BY toYYYYMMDD(event_time) + ORDER BY id;""" + node1.query(query_create) + node1.query("""INSERT INTO test VALUES (1, now())""") + node1.query("SYSTEM FLUSH LOGS;") - # query system.asynchronous_metrics - test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metrics WHERE metric='TotalPrimaryKeyBytesInMemory';" - assert "ok\n" in node1.query(test_query) + # query system.asynchronous_metrics + test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metrics WHERE metric = 'TotalPrimaryKeyBytesInMemory';" + assert "ok\n" in node1.query(test_query) - test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metrics WHERE metric='TotalPrimaryKeyBytesInMemoryAllocated';" - assert "ok\n" in node1.query(test_query) + test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metrics WHERE metric = 'TotalPrimaryKeyBytesInMemoryAllocated';" + assert "ok\n" in node1.query(test_query) - # query system.asynchronous_metric_log - test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metric_log WHERE metric='TotalPrimaryKeyBytesInMemory';" - assert "ok\n" in node1.query(test_query) + # query system.asynchronous_metric_log + test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metric_log WHERE metric = 'TotalPrimaryKeyBytesInMemory';" + assert "ok\n" in node1.query(test_query) - test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metric_log WHERE metric='TotalPrimaryKeyBytesInMemoryAllocated';" - assert "ok\n" in node1.query(test_query) - - finally: - cluster.shutdown() + test_query = "SELECT count() > 0 ? 'ok' : 'fail' FROM system.asynchronous_metric_log WHERE metric = 'TotalPrimaryKeyBytesInMemoryAllocated';" + assert "ok\n" in node1.query(test_query)