Skip to content

Commit

Permalink
[FIX ON MKI] x-pack/.../telemetry_config.ts (#197036)
Browse files Browse the repository at this point in the history
## Summary

See details: #197009
  • Loading branch information
wayneseymour authored Oct 21, 2024
1 parent 5fb1e12 commit 9c59469
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export class CoreAppsService {
if (latestOverrideVersion !== persistedOverrides.version) {
this.configService.setDynamicConfigOverrides(persistedOverrides.attributes);
latestOverrideVersion = persistedOverrides.version;
this.logger.info('Succeeded in applying persisted dynamic config overrides');
}
} catch (err) {
// Potential failures:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
* 2.0.
*/

import { expect } from 'expect';
import expect from '@kbn/expect';
import { expect as externalExpect } from 'expect';
import { SupertestWithRoleScopeType } from '@kbn/test-suites-xpack/api_integration/deployment_agnostic/services';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function telemetryConfigTest({ getService }: FtrProviderContext) {
const roleScopedSupertest = getService('roleScopedSupertest');
let supertestAdminWithApiKey: SupertestWithRoleScopeType;
let supertestAdminWithCookieCredentials: SupertestWithRoleScopeType;
const retry = getService('retry');
const retryTimeout = 20 * 1000;

describe('/api/telemetry/v2/config API Telemetry config', function () {
before(async () => {
Expand Down Expand Up @@ -42,7 +45,7 @@ export default function telemetryConfigTest({ getService }: FtrProviderContext)
it('GET should get the default config', async () => {
const { body } = await supertestAdminWithApiKey.get('/api/telemetry/v2/config').expect(200);

expect(body).toMatchObject(baseConfig);
externalExpect(body).toMatchObject(baseConfig);
});

it('GET should get updated labels after dynamically updating them', async () => {
Expand Down Expand Up @@ -71,7 +74,13 @@ export default function telemetryConfigTest({ getService }: FtrProviderContext)
.send({ 'telemetry.labels.journeyName': null })
.expect(200, { ok: true });

await supertestAdminWithApiKey.get('/api/telemetry/v2/config').expect(200, initialConfig);
await retry.tryForTime(retryTimeout, async function retryTelemetryConfigGetRequest() {
const { body } = await supertestAdminWithApiKey.get('/api/telemetry/v2/config').expect(200);
expect(body).to.eql(
initialConfig,
`Expected the response body to match the intitial config, but got: [${body}]`
);
});
});
});
}

0 comments on commit 9c59469

Please sign in to comment.