[Synthetics] Fix license flaky fetch (#137828)

This commit is contained in:
Shahzad 2022-08-03 11:09:23 +01:00 committed by GitHub
parent cc328ff6d5
commit c03820a9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -91,8 +91,7 @@ async function updateRoutingAllocations(
});
}
// FLAKY: https://github.com/elastic/kibana/issues/136990
describe.skip('incompatible_cluster_routing_allocation', () => {
describe('incompatible_cluster_routing_allocation', () => {
let client: ElasticsearchClient;
let root: Root;

View file

@ -103,20 +103,27 @@ export class TelemetryEventsSender {
this.isSending = false;
}
private async fetchClusterInfo(): Promise<InfoResponse> {
private async fetchClusterInfo(): Promise<InfoResponse | undefined> {
if (this.esClient === undefined || this.esClient === null) {
throw Error('elasticsearch client is unavailable: cannot retrieve cluster information');
}
return await this.esClient.info();
try {
return await this.esClient.info();
} catch (e) {
this.logger.debug(`Error fetching cluster information: ${e}`);
}
}
private async fetchLicenseInfo() {
if (this.esClient === undefined || this.esClient === null) {
throw Error('elasticsearch client is unavailable: cannot retrieve license information');
}
return await this.esClient.license.get();
try {
return await this.esClient.license.get();
} catch (e) {
this.logger.debug(`Error fetching license information: ${e}`);
}
}
public async sendEvents(telemetryUrl: string, queue: TelemetryQueue<any>) {