Skip to content

Commit

Permalink
Attempt to stabilize cloneIndex integration tests (elastic#86123)
Browse files Browse the repository at this point in the history
* Attempt to stabilize cloneIndex integration tests

* Unskip test

* return resolves/rejects and add assertions counts to each test

* Await don't return expect promises

* Await don't return expect promises for other tests too
  • Loading branch information
rudolf committed Dec 18, 2020
1 parent 04bc5ea commit d682954
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks';
import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors';

describe('catchRetryableEsClientErrors', () => {
it('rejects non-retryable response errors', () => {
it('rejects non-retryable response errors', async () => {
const error = new esErrors.ResponseError(
elasticsearchClientMock.createApiResponse({
body: { error: { type: 'cluster_block_exception' } },
statusCode: 400,
})
);
return expect(Promise.reject(error).catch(catchRetryableEsClientErrors)).rejects.toBe(error);
await expect(Promise.reject(error).catch(catchRetryableEsClientErrors)).rejects.toBe(error);
});
describe('returns left retryable_es_client_error for', () => {
it('NoLivingConnectionsError', async () => {
Expand Down
Loading

0 comments on commit d682954

Please sign in to comment.