[Synthetics] Fix license flaky fetch (#137828) (#137953)

(cherry picked from commit c03820a9c0)
This commit is contained in:
Shahzad 2022-08-03 12:34:33 +01:00 committed by GitHub
parent 849b4d67d0
commit be5fe0b665
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -90,8 +90,8 @@ async function updateRoutingAllocations(
[settingType]: { cluster: { routing: { allocation: { enable: value } } } },
});
}
// 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>) {