ClickHouse/tests/integration/test_trace_collector_serverwide/test.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.5 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
import time
2024-09-27 10:19:39 +00:00
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance("node1", main_configs=["configs/global_profiler.xml"])
2024-04-02 16:20:09 +00:00
@pytest.fixture(scope="module")
def start_cluster():
try:
cluster.start()
yield cluster
finally:
cluster.shutdown()
2024-04-02 16:20:09 +00:00
def test_global_thread_profiler(start_cluster):
2024-04-04 10:22:11 +00:00
if node1.is_built_with_sanitizer():
return
2024-04-02 16:20:09 +00:00
node1.query(
"CREATE TABLE t (key UInt32, value String) Engine = MergeTree() ORDER BY key"
)
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
node1.query("INSERT INTO t SELECT number, toString(number) from numbers(100)")
time.sleep(5)
node1.query("SYSTEM FLUSH LOGS")
2024-04-02 16:20:09 +00:00
assert (
int(
node1.query(
"SELECT count() FROM system.trace_log where trace_type='Real' and query_id = ''"
).strip()
)
> 0
)