meilisearch / meilisearch-rust

Rust wrapper for the Meilisearch API.

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests are failing since mockito update

bidoubiwa opened this issue · comments

Since the mockito update, the tests are panicking:

For example when testing test_delete_tasks_with_params_execute

meilisearch-rust/src/tasks.rs

Lines 1072 to 1089 in 6122c78

async fn test_delete_tasks_with_params_execute() -> Result<(), Error> {
let mock_server_url = &mockito::server_url();
let client = Client::new(mock_server_url, "masterKey");
let path = "/tasks?indexUids=movies,test&statuses=equeued&types=documentDeletion&uids=1";
let mock_res = mock("DELETE", path).with_status(200).create();
let mut query = TasksDeleteQuery::new(&client);
let _ = query
.with_index_uids(["movies", "test"])
.with_statuses(["equeued"])
.with_types(["documentDeletion"])
.with_uids([&1])
.execute()
.await;
mock_res.assert();
Ok(())

the outcome using this command:

cargo test test_delete_tasks_with_params_execute

Is as follow:

test tasks::test::test_delete_tasks_with_params_execute ... FAILED

failures:

---- tasks::test::test_delete_tasks_with_params_execute stdout ----
thread 'tasks::test::test_delete_tasks_with_params_execute' panicked at 'cannot execute `LocalPool` executor from within another executor: EnterError', /x/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.21/src/local_pool.rs:81:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

fixed by: #442