Skip to content

Commit

Permalink
force some failures to verify the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Dec 5, 2019
1 parent cc91eda commit cf2a58e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ describe('savedObjectsClient/decorateEsError', () => {
});

it('makes es.ConnectionFault a SavedObjectsClient/EsUnavailable error', () => {
const error = new esErrors.ConnectionFault();
expect(SavedObjectsErrorHelpers.isEsUnavailableError(error)).toBe(false);
expect(decorateEsError(error)).toBe(error);
expect(SavedObjectsErrorHelpers.isEsUnavailableError(error)).toBe(true);
throw new Error('force failure');
});

it('makes es.ServiceUnavailable a SavedObjectsClient/EsUnavailable error', () => {
Expand Down
8 changes: 3 additions & 5 deletions test/api_integration/apis/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ export default function ({ getService }) {
before(() => esArchiver.load('elasticsearch'));
after(() => esArchiver.unload('elasticsearch'));

it('allows search to specific index', async () => (
await supertest
.post('/elasticsearch/elasticsearch/_search')
.expect(200)
));
it('allows search to specific index', async () => {
throw new Error('force failure');
});

it('allows msearch', async () => (
await supertest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,7 @@ export default function ({ getService }) {
});

it('should remove non-recurring tasks after they complete', async () => {
await scheduleTask({
taskType: 'sampleTask',
params: { },
});

await retry.try(async () => {
const history = await historyDocs();
expect(history.length).to.eql(1);
expect((await currentTasks()).docs).to.eql([]);
});
throw new Error('force failure');
});

it('should use a given ID as the task document ID', async () => {
Expand Down

0 comments on commit cf2a58e

Please sign in to comment.