[QA] Add throttling to watches used for reporting tests (#134036)

* add throttling to reporting watches

* fix duplicate check

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Marius Dragomir 2022-06-15 19:53:42 +02:00 committed by GitHub
parent ee728cbb2a
commit 25ac988d47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -48,6 +48,7 @@ export default function ({ getService, getPageObjects }) {
interval: `${interval}s`,
},
},
throttle_period: '15m',
actions: {
email_admin: {
email: {

View file

@ -42,6 +42,7 @@ export default ({ getService, getPageObjects }) => {
interval: `${interval}s`,
},
},
throttle_period: '15m',
actions: {
email_admin: {
email: {
@ -78,6 +79,7 @@ export default ({ getService, getPageObjects }) => {
it('should successfully add a new watch for PNG Reporting', async () => {
await putWatcher(watch, id, body, client, log);
});
it('should be successful and increment revision', async () => {
await getWatcher(watch, id, client, log, PageObjects.common, retry.tryForTime.bind(retry));
});

View file

@ -18,11 +18,11 @@ export const putWatcher = async (watch, id, body, client, log) => {
expect(putWatchResponse.body._version).to.eql('1');
};
export const getWatcher = async (watch, id, client, log, common, tryForTime) => {
await common.sleep(50000);
await common.sleep(10000);
await tryForTime(
250000,
async () => {
await common.sleep(25000);
await common.sleep(3000);
await watcherHistory(id, client, log);
@ -31,7 +31,7 @@ export const getWatcher = async (watch, id, client, log, common, tryForTime) =>
expect(getWatchResponse.body._id).to.eql(id);
expect(getWatchResponse.body._version).to.be.above(1);
log.debug(`\n getWatchResponse.body._version: ${getWatchResponse.body._version}`);
expect(getWatchResponse.body.status.execution_state).to.eql('executed');
expect(getWatchResponse.body.status.execution_state).to.eql('throttled');
expect(getWatchResponse.body.status.actions.email_admin.last_execution.successful).to.eql(
true
);