Merge 'add stress test with 1 thread 10k iterations to ci' from Pere Diaz Bou

Add simple stress test run with 10k iteration to test `Delete`, `Update`
and `Insert` together.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #1585
This commit is contained in:
Pere Diaz Bou
2025-05-29 14:16:56 +02:00
3 changed files with 39 additions and 7 deletions

View File

@@ -27,4 +27,23 @@ jobs:
- name: Run ignored long tests
run: cargo test -- --ignored fuzz_long
env:
RUST_BACKTRACE: 1
RUST_BACKTRACE: 1
simple-stress-test:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 0
steps:
- uses: actions/checkout@v3
- uses: useblacksmith/rust-cache@v3
with:
prefix-key: "v1-rust"
- name: Set up Python 3.10
uses: useblacksmith/setup-python@v6
with:
python-version: "3.10"
- name: Build
run: cargo build --verbose
- name: Run ignored long tests
run: cargo run -p limbo_stress -- -t 1 -i 10000 -s
env:
RUST_BACKTRACE: 1

View File

@@ -309,18 +309,22 @@ fn generate_plan(opts: &Opts) -> Result<Plan, Box<dyn std::error::Error + Send +
nr_iterations: opts.nr_iterations,
nr_threads: opts.nr_threads,
};
writeln!(log_file, "{}", opts.nr_threads)?;
writeln!(log_file, "{}", opts.nr_iterations)?;
writeln!(log_file, "{}", ddl_statements.len())?;
for stmt in &ddl_statements {
writeln!(log_file, "{}", stmt)?;
if !opts.skip_log {
writeln!(log_file, "{}", opts.nr_threads)?;
writeln!(log_file, "{}", opts.nr_iterations)?;
writeln!(log_file, "{}", ddl_statements.len())?;
for stmt in &ddl_statements {
writeln!(log_file, "{}", stmt)?;
}
}
plan.ddl_statements = ddl_statements;
for _ in 0..opts.nr_threads {
let mut queries = vec![];
for _ in 0..opts.nr_iterations {
let sql = generate_random_statement(&schema);
// writeln!(log_file, "{}", sql)?;
if !opts.skip_log {
writeln!(log_file, "{}", sql)?;
}
queries.push(sql);
}
plan.queries_per_thread.push(queries);

View File

@@ -35,6 +35,15 @@ pub struct Opts {
)]
pub load_log: bool,
/// Skip writing to log file
#[clap(
short = 's',
long = "skip-log",
help = "load log file instead of creating a new one",
default_value_t = false
)]
pub skip_log: bool,
/// Database file
#[clap(
short = 'd',