Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uptime/usage-collector] add missing await #66079

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import { KibanaTelemetryAdapter } from '../kibana_telemetry_adapter';

jest
.spyOn(KibanaTelemetryAdapter, 'countNoOfUniqueMonitorAndLocations')
.mockResolvedValue(undefined as any);
Comment on lines +9 to +11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elastic/uptime This is necessary to get the tests passing because the error thrown by this method no longer is ignored. I'm assuming we want to write tests for this method, but I'm not familiar enough to fix it in this little path. Could someone from the uptime team make sure I'm not making things worse with this mock?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with merging this so long as tests are passing for now since it seems to affect CI stability. We'll make sure that the tests are fixed if need be.


describe('KibanaTelemetryAdapter', () => {
let usageCollection: any;
let getSavedObjectsClient: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class KibanaTelemetryAdapter {
fetch: async (callCluster: APICaller) => {
const savedObjectsClient = getSavedObjectsClient()!;
if (savedObjectsClient) {
this.countNoOfUniqueMonitorAndLocations(callCluster, savedObjectsClient);
await this.countNoOfUniqueMonitorAndLocations(callCluster, savedObjectsClient);
}
const report = this.getReport();
return { last_24_hours: { hits: { ...report } } };
Expand Down