Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize more settings #39663

Merged
merged 20 commits into from Dec 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 15 additions & 10 deletions tests/clickhouse-test
Expand Up @@ -395,6 +395,16 @@ class FailureReason(enum.Enum):
INTERNAL_ERROR = "Test internal error: "


def default_generator_for_bytes_setting():
return (
lambda: 0
if random.random() < 0.5
else 1
Copy link
Member

@nickitat nickitat Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm afraid that it may slow down some tests significantly. have you checked?

if random.random() < 0.2
else random.randint(1, 10 * 1024 * 1024 * 1024)
)


class SettingsRandomizer:
settings = {
"max_insert_threads": lambda: 0
Expand Down Expand Up @@ -427,16 +437,8 @@ class SettingsRandomizer:
"optimize_aggregation_in_order": lambda: random.randint(0, 1),
"aggregation_in_order_max_block_bytes": lambda: random.randint(0, 50000000),
"use_uncompressed_cache": lambda: random.randint(0, 1),
"min_bytes_to_use_direct_io": lambda: 0
if random.random() < 0.5
else 1
if random.random() < 0.2
else random.randint(1, 1024 * 1024 * 1024),
"min_bytes_to_use_mmap_io": lambda: 0
if random.random() < 0.5
else 1
if random.random() < 0.2
else random.randint(1, 1024 * 1024 * 1024),
"min_bytes_to_use_direct_io": default_generator_for_bytes_setting(),
"min_bytes_to_use_mmap_io": default_generator_for_bytes_setting(),
"local_filesystem_read_method": lambda: random.choice(
["read", "pread", "mmap", "pread_threadpool"]
),
Expand All @@ -448,6 +450,9 @@ class SettingsRandomizer:
"compile_sort_description": lambda: random.randint(0, 1),
"merge_tree_coarse_index_granularity": lambda: random.randint(2, 32),
"optimize_distinct_in_order": lambda: random.randint(0, 1),
"max_bytes_before_external_sort": default_generator_for_bytes_setting(),
"max_bytes_before_external_group_by": default_generator_for_bytes_setting(),
"max_bytes_before_remerge_sort": lambda: random.randint(1, 3000000000),
}

@staticmethod
Expand Down