Elasticsearch integration tests with Jest


I am using Elasticsearch (Opensearch) in a Nx monorepo in a node js serverless app that connects to aws services. I would like to use jest to test but so far I have not been able to get responses from Opensearch.

Even if I use the client directly in my test no response:

const { Client } = require("@opensearch-project/opensearch")
export const client = new Client({ node: "https://myurl.awszone.amazonaws.com" })

In my test:

            const data = await client.search(params)

Same error:
Async callback was not invoked within the 50000 ms timeout specified by jest.setTimeout.Error

I have incremented the time but same error.

Do you have any suggestions?

Opensearch is not a flavour ofElasticsearch, even though it started out as a fork of Elasticsearch with a set of third-party plugins. I would therefore recommend you reach out to the opensearch community as they are in a better position to provide recommendations on configuration and comopatibility of various clients.

Yep, you will need to ask aws about this as opensearch is their product.

Ok, thank you guys for your time.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.