Comments (4)
I have looked into creating and deleting the index with each test and the problem I have run into is because the tests are running in threads, the tests still fail. The reason for this is multiple tests can be running at the same time trying to use the same index name. One solution to this is to run the tests all in a single thread with cargo test -- --test-threads=1
. By doing this the tests no longer overlap and will pass, but the test take MUCH longer to run.
Some solutions I can currently think of are:
- Run all tests in a single thread
- Advantage: All indexes can have the same name
- Disadvantage: Slows down the tests
- Mock all the network calls
- Advantages:
- All indexes can have the same name
- Tests run fast
- Disadvantage: Since the main purpose of the client is to talk to Meilisearch through the API moving that to mocks seems like a bad idea.
- Advantages:
- Give each index a unique name
- Advantages:
- Tests run fast
- Can still use real network calls
- Disadvantage:
- Have to ensure that each index name across all files is unique.
- Doesn't look as good in docs
- Advantages:
from meilisearch-rust.
@sanders41 I have already thought about this issue. Your third solution has already been applied here and I plan to extend this structure to all other tests. However, there is another issue that you did not expect. For a reason I am unable to explain when tests make simultaneous requests to the MeiliSearch server, requests will hang and never get answers. So we cannot remove test-threads=1
anyway.
from meilisearch-rust.
For a reason I am unable to explain when tests make simultaneous requests to the MeiliSearch server, requests will hang and never get answers.
I have seen this issue also. I was guessing it was happening because of the index overlap, but sounds like your testing shows that isnβt the cause.
from meilisearch-rust.
Closed by #225
from meilisearch-rust.
Related Issues (20)
- Update code-samples based on docs team request (apr/23)
- [v1.3] [EXPERIMENTAL] Vector Store HOT 1
- [v1.3] Define fields to search on at search-time (`attributesToSearchOn`)
- [v1.3] Display hits ranking scores
- [v1.3] [EXPERIMENTAL] Display ranking details at search HOT 1
- [v1.3] Sort facets value by alphanumerical or count order
- [v1.3] Search in facet values `facetSearch`
- [v1.3] Total Tasks in task route
- Ensure the error handling are following the best practice HOT 1
- Add CodeCov HOT 2
- Quotation marks in primary silently fails entire `index.add_document` call. HOT 3
- SearchResults<T> doesn't implement trait serde::Serialize HOT 3
- [v1.4] Support text-separator customization
- [v1.4] Support user-dictionary loading HOT 1
- Library seems unusable on MacOS 14.0 HOT 1
- Index::add_documents_csv panics when File streaming HOT 2
- [v1.5] Add a new method for creating snapshots
- [v1.6] Support `proximityPrecision` setting
- [v1.6] support `embedders` setting HOT 3
- The X-MEILI-API-KEY header is missing. Please update the SDK HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meilisearch-rust.