diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 2ab354017f..c4b7a6baf4 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -70,7 +70,7 @@ where #[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())] async fn test_load_from_remote(sequencer: &RunnerCtx) { let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true); - let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/"); @@ -219,7 +219,7 @@ async fn test_load_from_remote(sequencer: &RunnerCtx) { #[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())] async fn test_load_from_remote_del(sequencer: &RunnerCtx) { let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true); - let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/"); @@ -321,7 +321,7 @@ async fn test_load_from_remote_del(sequencer: &RunnerCtx) { #[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())] async fn test_update_with_set_record(sequencer: &RunnerCtx) { let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true); - let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/"); diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 0a36bde6ca..427fe91210 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -278,7 +278,7 @@ pub async fn model_fixtures(db: &mut Sql) { pub async fn spinup_types_test() -> Result { // change sqlite::memory: to sqlite:~/.test.db to dump database to disk let options = SqliteConnectOptions::from_str("")?.create_if_missing(true).with_regexp(); - let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let setup = CompilerTestSetup::from_paths("../../dojo-core", &["../types-test"]); diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index e999d9df74..78482b74f5 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -34,7 +34,7 @@ use crate::types::schema::Entity; #[katana_runner::test(accounts = 10, db_dir = copy_spawn_and_move_db().as_str())] async fn test_entities_queries(sequencer: &RunnerCtx) { let options = SqliteConnectOptions::from_str("").unwrap().create_if_missing(true).with_regexp(); - let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + let pool = SqlitePoolOptions::new().min_connections(1).idle_timeout(None).max_lifetime(None).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let setup = CompilerTestSetup::from_examples("../../dojo-core", "../../../examples/");