[FIX ON MKI] x-pack/.../telemetry_config.ts (#197036)

## Summary

See details: https://github.com/elastic/kibana/issues/197009
This commit is contained in:
Tre 2024-10-21 16:01:56 +01:00 committed by GitHub
parent 5fb1e127ad
commit 9c5946976d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View file

@ -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:

View file

@ -5,7 +5,8 @@
* 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';
@ -13,6 +14,8 @@ 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 () => {
@ -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 () => {
@ -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}]`
);
});
});
});
}