diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index f3c077c05..e5aa1553a 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -286,6 +286,12 @@ impl Deref for MaxMemory { } } +impl MaxMemory { + pub fn unlimited() -> Self { + Self(None) + } +} + /// Returns the total amount of bytes available or `None` if this system isn't supported. fn total_memory_bytes() -> Option { if System::IS_SUPPORTED { diff --git a/meilisearch-http/tests/common/server.rs b/meilisearch-http/tests/common/server.rs index 6cf1acb6a..52c0e30ea 100644 --- a/meilisearch-http/tests/common/server.rs +++ b/meilisearch-http/tests/common/server.rs @@ -7,7 +7,7 @@ use tempdir::TempDir; use urlencoding::encode; use meilisearch_http::data::Data; -use meilisearch_http::option::{IndexerOpts, Opt}; +use meilisearch_http::option::{IndexerOpts, MaxMemory, Opt}; use super::index::Index; use super::service::Service; @@ -90,7 +90,11 @@ pub fn default_settings(dir: impl AsRef) -> Opt { schedule_snapshot: false, snapshot_interval_sec: 0, import_dump: None, - indexer_options: IndexerOpts::default(), + indexer_options: IndexerOpts { + // memory has to be unlimited because several meilisearch are running in test context. + max_memory: MaxMemory::unlimited(), + ..Default::default() + }, log_level: "off".into(), } }