chore: reduce sleep time

This commit is contained in:
WenyXu
2024-04-18 13:59:20 +00:00
parent bf07dd275a
commit c7400a4182
2 changed files with 11 additions and 5 deletions

View File

@@ -54,9 +54,9 @@ async fn main() {
loop {
warn!("Staring");
let pid = start_database().await.expect("Failed to start database");
let secs = rng.gen_range(1..2);
let secs = rng.gen_range(100..300);
moved_state.killed.store(false, Ordering::Relaxed);
tokio::time::sleep(Duration::from_secs(secs)).await;
tokio::time::sleep(Duration::from_millis(secs)).await;
warn!("After {secs}s, Killing pid: {pid}");
moved_state.killed.store(true, Ordering::Relaxed);
ProcessManager::kill(pid, Signal::SIGKILL).expect("Failed to kill");
@@ -155,7 +155,7 @@ async fn start_database() -> Result<Pid> {
let pid = start_process(&process_manager, binary_path, test_dir, template_filename)
.await
.unwrap();
tokio::time::timeout(Duration::from_secs(10), health_check(health_url))
tokio::time::timeout(Duration::from_secs(100), health_check(health_url))
.await
.expect("Failed to start GreptimeDB process");
info!("GreptimeDB started, pid: {pid}");

View File

@@ -18,7 +18,10 @@ use rand::Rng;
use serde::Serialize;
use snafu::ResultExt;
use tests_fuzz::context::TableContextRef;
use tests_fuzz::fake::WordGenerator;
use tests_fuzz::fake::{
merge_two_word_map_fn, random_capitalize_map, uppercase_and_keyword_backtick_map,
MappedGenerator, WordGenerator,
};
use tests_fuzz::generator::alter_expr::{
AlterExprAddColumnGeneratorBuilder, AlterExprDropColumnGeneratorBuilder,
AlterExprRenameGeneratorBuilder,
@@ -63,7 +66,10 @@ pub(crate) fn render_config_file<C: Serialize>(template_path: &str, context: &C)
pub(crate) fn generate_create_table_expr<R: Rng + 'static>(rng: &mut R) -> CreateTableExpr {
let columns = rng.gen_range(2..30);
let create_table_generator = CreateTableExprGeneratorBuilder::default()
.name_generator(Box::new(WordGenerator))
.name_generator(Box::new(MappedGenerator::new(
WordGenerator,
merge_two_word_map_fn(random_capitalize_map, uppercase_and_keyword_backtick_map),
)))
.columns(columns)
.engine("mito")
.build()