mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
The test asserted the old default value `true` of `nuraft_use_bg_thread_for_snapshot_io` reported by the `conf` four-letter command, while this PR changes the default to `false`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106842&sha=latest&name_0=PR PR: https://github.com/ClickHouse/ClickHouse/pull/106842 Co-Authored-By: Claude Fable 5 <[email protected]>
46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
import pytest
|
|
import helpers.keeper_utils as keeper_utils
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
cluster = ClickHouseCluster(__file__)
|
|
node1 = cluster.add_instance(
|
|
"node1",
|
|
main_configs=["configs/enable_keeper1.xml"],
|
|
stay_alive=True,
|
|
)
|
|
node2 = cluster.add_instance(
|
|
"node2",
|
|
main_configs=["configs/enable_keeper2.xml"],
|
|
stay_alive=True,
|
|
)
|
|
node3 = cluster.add_instance(
|
|
"node3",
|
|
main_configs=["configs/enable_keeper3.xml"],
|
|
stay_alive=True,
|
|
)
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def started_cluster():
|
|
try:
|
|
cluster.start()
|
|
keeper_utils.wait_nodes(cluster, [node1, node2, node3])
|
|
yield cluster
|
|
finally:
|
|
cluster.shutdown()
|
|
|
|
|
|
def test_streaming_mode(started_cluster):
|
|
conf = keeper_utils.send_4lw_cmd(cluster, node1, "conf")
|
|
assert "nuraft_use_bg_thread_for_snapshot_io=false" in conf
|
|
assert "nuraft_streaming_mode=true" in conf, f"Streaming mode not found in conf output:\n{conf}"
|
|
assert "nuraft_max_log_gap_in_stream=16" in conf
|
|
assert "nuraft_max_bytes_in_flight_in_stream=4194304" in conf
|
|
assert "nuraft_max_uncommitted_log_entries=12345" in conf
|
|
assert "nuraft_append_entries_backward_probe_throttle_threshold=7" in conf
|
|
|
|
log = node1.grep_in_log("streaming mode max log gap")
|
|
assert log, "NuRaft startup message with streaming mode parameters not found in log"
|
|
assert "16" in log, f"Expected max_log_gap=16 in log message: {log}"
|
|
assert "max uncommitted log entries 12345" in log
|