diff --git a/x-pack/legacy/plugins/ml/public/application/management/index.ts b/x-pack/legacy/plugins/ml/public/application/management/index.ts index 16bb3ddfd1c9b..a6d1bbfcee9f6 100644 --- a/x-pack/legacy/plugins/ml/public/application/management/index.ts +++ b/x-pack/legacy/plugins/ml/public/application/management/index.ts @@ -15,6 +15,7 @@ import { management } from 'ui/management'; import { i18n } from '@kbn/i18n'; import chrome from 'ui/chrome'; import { metadata } from 'ui/metadata'; +import { take } from 'rxjs/operators'; import { JOBS_LIST_PATH } from './management_urls'; import { setDependencyCache } from '../util/dependency_cache'; import './jobs_list'; @@ -31,11 +32,11 @@ type PluginsSetupExtended = typeof npSetup.plugins & { }; const plugins = npSetup.plugins as PluginsSetupExtended; -const licencingSubscription = plugins.licensing.license$.subscribe(license => { +// only need to register once +const licensing = plugins.licensing.license$.pipe(take(1)); +licensing.subscribe(license => { if (license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === LICENSE_CHECK_STATE.Valid) { initManagementSection(); - // unsubscribe, we only want to register the plugin once. - licencingSubscription.unsubscribe(); } }); diff --git a/x-pack/test/functional/apps/lens/lens_reporting.ts b/x-pack/test/functional/apps/lens/lens_reporting.ts index 4667f9d5860ee..3d70390a2de41 100644 --- a/x-pack/test/functional/apps/lens/lens_reporting.ts +++ b/x-pack/test/functional/apps/lens/lens_reporting.ts @@ -14,8 +14,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const listingTable = getService('listingTable'); - // FLAKY: https://github.com/elastic/kibana/issues/59229 - describe.skip('lens reporting', () => { + describe('lens reporting', () => { before(async () => { await esArchiver.loadIfNeeded('lens/reporting'); });