Skip to main content

Module test_util

Module test_util 

Source

Structsยง

FileDirGuard
StorageGuard
TempDirGuard
TestGuard

Enumsยง

MockInstanceImpl
A test instance backed by embedded storage or a distributed cluster.
StorageType

Constantsยง

PEER_PLACEHOLDER_ADDR

Functionsยง

assert_wal_delta
Require a real write, then check WAL policy independently of row deduplication.
build_test_prom_server
Builds Prometheus HTTP routes for either a standalone or distributed frontend. memory_limiter must be set before the handlers are wired (handlers capture the limiter at wiring time, mirroring production in frontend::server).
create_datanode_opts ๐Ÿ”’
create_test_table ๐Ÿ”’
create_tmp_dir_and_datanode_opts
execute_sql
execute_sql_and_expect
flush_and_snapshot_region_wal ๐Ÿ”’
Flush user data regions before observing their persisted WAL watermarks. Metadata regions write WAL independently and are excluded from this check.
get_test_store_config
prepare_another_catalog_and_schema ๐Ÿ”’
prepare_another_catalog_and_schema_with_kv_backend ๐Ÿ”’
prepare_another_catalog_and_schema_with_manager ๐Ÿ”’
run_sql ๐Ÿ”’
s3_test_config ๐Ÿ”’
setup_authenticated_grpc_database
Starts a gRPC server backed by instance and returns a client authenticated as the supplied test user. The server handle keeps the listener alive.
setup_grpc_server
setup_grpc_server_for_frontend_instance
Builds and starts an authenticated gRPC server on an existing frontend instance.
setup_grpc_server_for_frontend_instance_with ๐Ÿ”’
setup_grpc_server_for_instance ๐Ÿ”’
Builds and starts a gRPC server on top of an already-constructed standalone instance. This is the shared core behind the setup_grpc_server_* helpers.
setup_grpc_server_with
setup_grpc_server_with_auto_create_table_disabled
Sets up a gRPC server backed by a standalone instance whose frontend has auto table creation disabled, for testing the server-side global switch.
setup_grpc_server_with_user_provider
setup_mysql_server
setup_mysql_server_with_slow_query_threshold
setup_mysql_server_with_user_provider
setup_pg_server
setup_pg_server_with_prom_native_histogram
Sets up a standalone instance with both a Prometheus remote-write HTTP app (native histograms enabled) and a Postgres server attached, so native histogram data written via remote-write can be queried over the Postgres protocol.
setup_pg_server_with_slow_query_threshold
setup_pg_server_with_user_provider
setup_standalone_instance ๐Ÿ”’
setup_standalone_instance_with_plugins ๐Ÿ”’
setup_standalone_instance_with_plugins_and_slow_query_threshold ๐Ÿ”’
setup_standalone_instance_with_slow_query_threshold ๐Ÿ”’
setup_test_http_app
setup_test_http_app_with_frontend
setup_test_http_app_with_frontend_and_custom_options
setup_test_http_app_with_frontend_and_slow_query_threshold
setup_test_http_app_with_frontend_and_user_provider
setup_test_prom_app_with_frontend
setup_test_prom_app_with_frontend_and_memory_limiter
Like setup_test_prom_app_with_frontend but wires a shared request-memory limiter into the server, mirroring production deployments that configure max_in_flight_write_bytes.
setup_test_prom_app_with_frontend_batched
Like setup_test_prom_app_with_frontend but enables the pending-rows batcher, so Prometheus remote write goes through the batched (metric-engine) path instead of the direct PromStoreProtocolHandler::write path.
setup_test_prom_app_with_frontend_inner ๐Ÿ”’
test_event_recorder_options
Event recorder options for tests.
try_execute_sql

Type Aliasesยง

WalSnapshot
Maps (node_id, region_id) to (flushed_sequence, flushed_entry_id).