Commit Graph

69 Commits

Author SHA1 Message Date
Bob Peterson
b92f4cb9c4 Make Miri easier to run 2025-10-20 23:48:19 -05:00
Bob Peterson
5d7b057b8a Enable turso_stress to run in Miri
antithesis_sdk needs to have default features disabled in the workspace
so turso_stress is free to select the noop implementation for Miri
2025-10-20 22:50:44 -05:00
Jussi Saurio
bae3a42564 stress: prevent thread from holding write lock and then stopping
When a stress thread runs out of work, execute COMMIT and ignore
the result.

This prevents the currently extremely common scenario where:

- Thread x does BEGIN
- Thread x does e.g. INSERT ...

Then runs out of iterations and stops. No other threads can write
anything and they just wait for 5 seconds (busy timeout) and then
try again, forever.
2025-10-17 08:47:40 +03:00
pedrocarlo
d3bb8beb17 Run SQLite integrity check after stress test run 2025-10-14 13:50:50 -03:00
Pekka Enberg
7b1b37095d stress: Add busy timeout support with 5 second default
Add `--busy-timeout` command-line option to turso-stress with a default
value of 5000 ms. This helps prevent spurious database busy errors
during concurrent stress testing and ensure that integrity checks are
not skipped because of concurrent writes.
2025-10-13 09:11:10 +03:00
Pekka Enberg
0157ffec7f Merge 'stress: add option to choose how many tables to generate' from Pere Diaz Bou
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3460
2025-09-30 19:37:35 +03:00
Pere Diaz Bou
9993a83be4 stress: add option to choose how many tables to generate 2025-09-30 15:41:57 +02:00
Nikita Sivukhin
9d7e28ac43 fix clippy 2025-09-30 11:39:17 +04:00
Nikita Sivukhin
f3a148b802 keep db file 2025-09-30 11:37:43 +04:00
Nikita Sivukhin
5086480b28 small improvement of stress testing tool 2025-09-29 20:18:10 +04:00
Pekka Enberg
31ff7d196b stress: Retry sync on error to avoid a panic, take 2
Commit eeab6d5ce ("stress: Retry sync on error to avoid a panic") only
enabled sync retry in the schema creation path. Let's add it to the
stress test loop too.

Spotted during Antithesis runs.
2025-09-18 11:38:11 +03:00
pedrocarlo
3c91ae206b move as many dependencies as possible to workspace to avoid multiple versions of the same dependency 2025-09-15 17:19:36 -03:00
Pekka Enberg
eeab6d5ce0 stress: Retry sync on error to avoid a panic
We now panic on fsync error by default to be safe against fsyncgate.
However, no reason to do that in the stress tester, especially since we
test out of disk space errors under Antithesis.
2025-09-15 14:21:53 +03:00
Pekka Enberg
9655b455ed Clippy you are so smart 2025-09-10 13:54:42 +03:00
Pekka Enberg
0287512a47 stress: Disable database reopen and reconnect
Nikita noticed that database reopen and reconnet cause most database
operations to return "database locked", which means we're not getting
the coverage we need.
2025-09-10 11:50:22 +03:00
Pekka Enberg
f61e26eeb1 stress: Add --vfs <io-method> command line option
...unlocks io_uring stress runs.
2025-09-04 19:15:01 +03:00
Pekka Enberg
2fcb9dd76f stress: Use CREATE TABLE IF NOT EXISTS to create schema
Different threads might attempt to create the same tables so avoid
spurious errors printed out to the logs with `CREATE TABLE IF NOT
EXISTS`.
2025-09-04 18:56:05 +03:00
Pekka Enberg
adb538e61a stress: Don't die if database is locked during integrity check 2025-09-04 18:48:12 +03:00
Pekka Enberg
46eb3e2761 stress: Don't hang if table creation fails 2025-08-20 13:50:04 +03:00
Jussi Saurio
86b1232268 chore: enable indexes by default 2025-08-01 15:44:56 +03:00
Pekka Enberg
b1c0ba4da0 stress: Allow multi-threading but warn about it 2025-07-25 16:53:02 +03:00
Jussi Saurio
dce355d9b7 test/stress&sim: enable indexes by default 2025-07-21 11:49:30 +03:00
Jussi Saurio
a48b6d049a Another post-rebase clippy round with 1.88.0 2025-07-12 19:10:56 +03:00
Jussi Saurio
1bda8bb47a stress clippy 2025-07-09 10:41:18 +03:00
Pekka Enberg
a1ab0f12ea stress: Make error reporting less verbose by default 2025-07-09 10:18:23 +03:00
Jussi Saurio
0762c8f780 stress: add a way to run stress with indexes enabled 2025-07-07 13:04:52 +03:00
Pekka Enberg
b9bba101d4 Rename limbo_stress to turso_stress 2025-07-04 12:53:58 +03:00
Pere Diaz Bou
cde7202981 Revert "Merge 'core: Disable ROLLBACK statement' from Pekka Enberg"
This reverts commit 8a13e4b02f, reversing
changes made to cc935f97cc.
2025-07-03 12:36:48 +02:00
Pekka Enberg
ca990e8fd1 Revert "Merge 'Rust binding improvements' from Pedro Muniz"
This reverts commit bd60cd214c, reversing
changes made to 74e48a3a8f because it
makes limbo_stress hang.
2025-07-03 12:28:10 +03:00
pedrocarlo
78107935b5 clippy 2025-06-30 15:29:09 -03:00
Pekka Enberg
2542cb2d03 core: Disable ROLLBACK statement
There's bad interaction with schema changes and `ROLLBACK`:

https://github.com/tursodatabase/turso/issues/1890

Disable the statement for now to avoid people hitting the issue.
2025-06-30 17:30:01 +03:00
Pekka Enberg
592ad81c86 Rename limbo crate to turso 2025-06-29 13:07:57 +03:00
Pekka Enberg
645c0bd796 core: Add Antithesis-aware turso_assert
This adds a `turso_assert` macro that is Antithesis aware when
`antithesis` feature flag is enabled. I did not yet convert any
call-sites to use it.

Co-authored-by: Nikita Sivukhin <sivukhin@turso.tech>
2025-06-29 11:46:18 +03:00
Pekka Enberg
bcaff77287 stress: Log reopen and reconnect
Stress runs have bunch of errors like this caused by reconnect in the
middle of a transaction:

```
Error executing query: Transaction error: cannot rollback - no transaction is active
```

This is fine, but let's add some logging that it's obvious why this
happens.
2025-06-29 09:48:47 +03:00
Pekka Enberg
2fc5c0ce5c Switch to runtime flag for enabling indexes
Makes it easier to test the feature:

```
$ cargo run --  --experimental-indexes
Limbo v0.0.22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database
limbo> CREATE TABLE t(x);
limbo> CREATE INDEX t_idx ON t(x);
limbo> DROP INDEX t_idx;
```
2025-06-26 10:07:28 +03:00
Pekka Enberg
7c6fdbdfad stress: Thank you Clippy
Thank you for spotting these terrible, terrible programming mistakes.
2025-06-26 09:06:01 +03:00
Pekka Enberg
5be52a5260 stress: Interactive transactions 2025-06-25 20:02:09 +03:00
Jussi Saurio
4999d0ed95 stress: reopen db / reconnect to db every now and then 2025-06-24 16:34:13 +03:00
Jussi Saurio
27b2c2530b test/stress: only do integrity_check every 100 queries 2025-06-24 13:13:31 +03:00
pedrocarlo
13a55948d5 bring back some merge conflicts code 2025-06-23 23:01:28 -03:00
Nils Koch
2827b86917 chore: fix clippy warnings 2025-06-23 19:52:13 +01:00
Pekka Enberg
963d7b7daf stress: Improve progress reporting
A stress run can take a long time. Improve progress reporting to improve
DX.
2025-06-23 17:25:38 +03:00
Pekka Enberg
ea2b15a4de stress: Disable multi-threaded testing
Depends on https://github.com/tursodatabase/limbo/issues/1552
2025-06-19 09:31:43 +03:00
Pere Diaz Bou
9aecc1c903 disable constraints on stress test
without indexes constraints are useless
2025-06-18 12:45:04 +02:00
Pekka Enberg
d148f66670 stress: Make sure we run integrity check after every step
Spotted by Jussi.
2025-06-16 16:18:52 +03:00
Pekka Enberg
08bb4665b6 stress: Run integrity check for every iteration 2025-06-16 15:08:49 +03:00
Jussi Saurio
062469936d test/stress: use tempfile unless opts.db_file given 2025-06-04 10:02:27 +03:00
Pere Diaz Bou
968eeea75d 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
2025-05-29 14:16:56 +02:00
krishna sindhur
4b66bcb2a7 fix: stress test will ignore unique constraint violation 2025-05-29 15:11:43 +05:30
Pere Diaz Bou
650a5b8b1a skip writing to log on CI 2025-05-27 11:31:51 +02:00