mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
reduce the number of thread spawned by milli
This commit is contained in:
parent
b53a019b07
commit
6666c57880
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::str::FromStr as _;
|
use std::str::FromStr;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use actix_http::body::MessageBody;
|
use actix_http::body::MessageBody;
|
||||||
@ -345,6 +345,7 @@ pub fn default_settings(dir: impl AsRef<Path>) -> Opt {
|
|||||||
// memory has to be unlimited because several meilisearch are running in test context.
|
// memory has to be unlimited because several meilisearch are running in test context.
|
||||||
max_indexing_memory: MaxMemory::unlimited(),
|
max_indexing_memory: MaxMemory::unlimited(),
|
||||||
skip_index_budget: true,
|
skip_index_budget: true,
|
||||||
|
// We cannot use more than 1 indexing threads otherwise some tests become non-deterministic
|
||||||
max_indexing_threads: MaxThreads::from_str("1").unwrap(),
|
max_indexing_threads: MaxThreads::from_str("1").unwrap(),
|
||||||
},
|
},
|
||||||
experimental_enable_metrics: false,
|
experimental_enable_metrics: false,
|
||||||
|
@ -651,7 +651,7 @@ async fn fetch_document_by_filter() {
|
|||||||
let server = Server::new_shared();
|
let server = Server::new_shared();
|
||||||
let index = server.unique_index();
|
let index = server.unique_index();
|
||||||
index.update_settings_filterable_attributes(json!(["color"])).await;
|
index.update_settings_filterable_attributes(json!(["color"])).await;
|
||||||
index
|
let (task, _code) = index
|
||||||
.add_documents(
|
.add_documents(
|
||||||
json!([
|
json!([
|
||||||
{ "id": 0, "color": "red" },
|
{ "id": 0, "color": "red" },
|
||||||
@ -662,7 +662,7 @@ async fn fetch_document_by_filter() {
|
|||||||
Some("id"),
|
Some("id"),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
index.wait_task(1).await;
|
index.wait_task(task.uid()).await.succeeded();
|
||||||
|
|
||||||
let (response, code) = index.get_document_by_filter(json!(null)).await;
|
let (response, code) = index.get_document_by_filter(json!(null)).await;
|
||||||
snapshot!(code, @"400 Bad Request");
|
snapshot!(code, @"400 Bad Request");
|
||||||
@ -745,8 +745,9 @@ async fn fetch_document_by_filter() {
|
|||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn retrieve_vectors() {
|
async fn retrieve_vectors() {
|
||||||
let server = Server::new_shared();
|
let index = shared_empty_index().await;
|
||||||
let index = server.unique_index();
|
|
||||||
|
// GET ALL DOCUMENTS BY QUERY
|
||||||
let (response, _code) = index.get_all_documents_raw("?retrieveVectors=tamo").await;
|
let (response, _code) = index.get_all_documents_raw("?retrieveVectors=tamo").await;
|
||||||
snapshot!(response, @r###"
|
snapshot!(response, @r###"
|
||||||
{
|
{
|
||||||
|
@ -66,8 +66,8 @@ async fn list_tasks() {
|
|||||||
async fn list_tasks_with_star_filters() {
|
async fn list_tasks_with_star_filters() {
|
||||||
let server = Server::new().await;
|
let server = Server::new().await;
|
||||||
let index = server.index("test");
|
let index = server.index("test");
|
||||||
index.create(None).await;
|
let (task, _code) = index.create(None).await;
|
||||||
index.wait_task(0).await;
|
index.wait_task(task.uid()).await;
|
||||||
index
|
index
|
||||||
.add_documents(serde_json::from_str(include_str!("../assets/test_set.json")).unwrap(), None)
|
.add_documents(serde_json::from_str(include_str!("../assets/test_set.json")).unwrap(), None)
|
||||||
.await;
|
.await;
|
||||||
|
Loading…
Reference in New Issue
Block a user