Skip to content

Commit

Permalink
Merge branch 'master' into maps/show_icons
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed May 14, 2020
2 parents 094b012 + 8652bed commit 09a05d9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
29 changes: 13 additions & 16 deletions packages/kbn-es/src/utils/native_realm.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ exports.NativeRealm = class NativeRealm {
}

const reservedUsers = await this.getReservedUsers();
if (!reservedUsers || reservedUsers.length < 1) {
throw new Error('no reserved users found, unable to set native realm passwords');
}

await Promise.all(
reservedUsers.map(async user => {
await this.setPassword(user, options[`password.${user}`]);
Expand All @@ -88,16 +84,18 @@ exports.NativeRealm = class NativeRealm {
}

async getReservedUsers() {
const users = await this._autoRetry(async () => {
return await this._client.security.getUser();
});
return await this._autoRetry(async () => {
const resp = await this._client.security.getUser();
const usernames = Object.keys(resp.body).filter(
user => resp.body[user].metadata._reserved === true
);

return Object.keys(users.body).reduce((acc, user) => {
if (users.body[user].metadata._reserved === true) {
acc.push(user);
if (!usernames?.length) {
throw new Error('no reserved users found, unable to set native realm passwords');
}
return acc;
}, []);

return usernames;
});
}

async isSecurityEnabled() {
Expand Down Expand Up @@ -125,10 +123,9 @@ exports.NativeRealm = class NativeRealm {
throw error;
}

this._log.warning(
'assuming [elastic] user not available yet, waiting 1.5 seconds and trying again'
);
await new Promise(resolve => setTimeout(resolve, 1500));
const sec = 1.5 * attempt;
this._log.warning(`assuming ES isn't initialized completely, trying again in ${sec} seconds`);
await new Promise(resolve => setTimeout(resolve, sec * 1000));
return await this._autoRetry(fn, attempt + 1);
}
}
Expand Down
3 changes: 1 addition & 2 deletions x-pack/test/functional/apps/dashboard/_async_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
'timePicker',
]);

// FLAKY: https://github.com/elastic/kibana/issues/65949
describe.skip('sample data dashboard', function describeIndexTests() {
describe('sample data dashboard', function describeIndexTests() {
before(async () => {
await PageObjects.common.sleep(5000);
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
Expand Down
5 changes: 3 additions & 2 deletions x-pack/test/functional_endpoint/apps/endpoint/policy_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const policyTestResources = getService('policyTestResources');

describe('When on the Endpoint Policy List', function() {
// FLAKY: https://github.com/elastic/kibana/issues/66579
describe.skip('When on the Endpoint Policy List', function() {
this.tags(['ciGroup7']);
before(async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/policy');
Expand Down Expand Up @@ -46,7 +47,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
expect(noItemsFoundMessage).to.equal('No items found');
});

describe('and policies exists', () => {
xdescribe('and policies exists', () => {
let policyInfo: PolicyTestResourceInfo;

before(async () => {
Expand Down

0 comments on commit 09a05d9

Please sign in to comment.