[Actions] Better enqueue test (#112434)

* Try and add logging here

* Fix linting

* Only this test

* Better logging

* More debugging

* More debug

* Try something different

* Better way to do the test

* Get this PR ready

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Chris Roberson 2021-09-30 08:55:36 -04:00 committed by GitHub
parent 2548f9b323
commit fb2ee109b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View file

@ -213,6 +213,7 @@ function getNoAttemptsRateLimitedActionType() {
});
return {
status: 'error',
message: 'intentional failure from action',
retry: new Date(params.retryAt),
actionId: '',
};

View file

@ -23,8 +23,7 @@ export default function ({ getService }: FtrProviderContext) {
const retry = getService('retry');
const esTestIndexTool = new ESTestIndexTool(es, retry);
// Failing: See https://github.com/elastic/kibana/issues/111812
describe.skip('enqueue', () => {
describe('enqueue', () => {
const objectRemover = new ObjectRemover(supertest);
before(async () => {
@ -170,21 +169,17 @@ export default function ({ getService }: FtrProviderContext) {
'task.taskType': 'actions:test.no-attempts-rate-limit',
},
},
{
term: {
'task.status': 'running',
},
},
],
},
},
},
});
expect((runningSearchResult.body.hits.total as estypes.SearchTotalHits).value).to.eql(1);
const total = (runningSearchResult.body.hits.total as estypes.SearchTotalHits).value;
expect(total).to.eql(1);
});
await retry.try(async () => {
const searchResult = await es.search({
const runningSearchResult = await es.search({
index: '.kibana_task_manager',
body: {
query: {
@ -200,7 +195,8 @@ export default function ({ getService }: FtrProviderContext) {
},
},
});
expect((searchResult.body.hits.total as estypes.SearchTotalHits).value).to.eql(0);
const total = (runningSearchResult.body.hits.total as estypes.SearchTotalHits).value;
expect(total).to.eql(0);
});
});
});