diff --git a/.env.example b/.env.example index 369ebb8e2f43..50bee2932737 100644 --- a/.env.example +++ b/.env.example @@ -24,3 +24,6 @@ GT_KAFKA_ENDPOINTS = localhost:9092 # Setting for fuzz tests GT_MYSQL_ADDR = localhost:4002 + +# Setting for usntable fuzz tests +GT_FUZZ_BINARY_PATH=/home/weny/Projects/greptimedb/target/debug/greptime \ No newline at end of file diff --git a/tests-fuzz/README.md b/tests-fuzz/README.md index c1e2147fb4bd..81b4806c703b 100644 --- a/tests-fuzz/README.md +++ b/tests-fuzz/README.md @@ -9,6 +9,25 @@ cargo install cargo-fuzz 2. Start GreptimeDB 3. Copy the `.env.example`, which is at project root, to `.env` and change the values on need. +### For stable fuzz tests +Set the GreptimeDB MySQL address. +``` +GT_MYSQL_ADDR = localhost:4002 +``` + +### For unstable fuzz tests +Set the binary path of the GreptimeDB: +``` +GT_FUZZ_BINARY_PATH = /path/to/ +``` + +Change the instance root directory(the default value: `/tmp/unstable_greptime/`) +``` +GT_FUZZ_BINARY_PATH = /path/to/ +``` + + + ## Run 1. List all fuzz targets ```bash diff --git a/tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs b/tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs index 8e306156f4fd..13e4f9a3d7cc 100644 --- a/tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs +++ b/tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs @@ -157,7 +157,7 @@ async fn execute_unstable_create_table( loop { let sql = "DROP DATABASE IF EXISTS public"; - match sqlx::query(&sql).execute(&ctx.greptime).await { + match sqlx::query(sql).execute(&ctx.greptime).await { Ok(result) => { info!("Drop table: {}, result: {result:?}", sql); break;