Skip to content

Commit

Permalink
Merge branch 'master' into check-platinum-license
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 11, 2021
2 parents 776f24d + f88901c commit 99500f3
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 6 deletions.
10 changes: 10 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
labels: ['Team:Operations', 'release_note:skip'],
enabled: true,
},
{
groupName: 'polyfills',
packageNames: ['core-js'],
matchPackagePatterns: ["polyfill"],
excludePackageNames: ['@loaders.gl/polyfills'],
reviewers: ['team:kibana-operations'],
matchBaseBranches: ['master'],
labels: ['Team:Operations', 'release_note:skip'],
enabled: true,
},
{
groupName: 'vega related modules',
packageNames: ['vega', 'vega-lite', 'vega-schema-url-parser', 'vega-tooltip'],
Expand Down
26 changes: 26 additions & 0 deletions src/core/server/environment/environment_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,32 @@ describe('UuidService', () => {
expect(logger.get('process').warn).not.toHaveBeenCalled();
});
});

describe('unhandledRejection warnings', () => {
it('logs warn for an unhandeld promise rejected with an Error', async () => {
await service.preboot();

const err = new Error('something went wrong');
process.emit('unhandledRejection', err, new Promise((res, rej) => rej(err)));

expect(logger.get('process').warn).toHaveBeenCalledTimes(1);
expect(loggingSystemMock.collect(logger).warn[0][0]).toMatch(
/Detected an unhandled Promise rejection: Error: something went wrong\n.*at /
);
});

it('logs warn for an unhandeld promise rejected with a string', async () => {
await service.preboot();

const err = 'something went wrong';
process.emit('unhandledRejection', err, new Promise((res, rej) => rej(err)));

expect(logger.get('process').warn).toHaveBeenCalledTimes(1);
expect(loggingSystemMock.collect(logger).warn[0][0]).toMatch(
/Detected an unhandled Promise rejection: "something went wrong"/
);
});
});
});

describe('#setup()', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/core/server/environment/environment_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ export class EnvironmentService {
this.configService.atPath<PidConfigType>(pidConfigDef.path).pipe(take(1)).toPromise(),
]);

// was present in the legacy `pid` file.
// Log unhandled rejections so that we can fix them in preparation for https://github.com/elastic/kibana/issues/77469
process.on('unhandledRejection', (reason) => {
this.log.warn(`Detected an unhandled Promise rejection.\n${reason}`);
const message = (reason as Error)?.stack ?? JSON.stringify(reason);
this.log.warn(`Detected an unhandled Promise rejection: ${message}`);
});

process.on('warning', (warning) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useState, useCallback } from 'react';
import { EuiTableSortingType } from '@elastic/eui';
import { euiTableStorageGetter, euiTableStorageSetter } from '../../components/table';
import { Storage } from '../../../../../../src/plugins/kibana_utils/public';
import { EUI_SORT_ASCENDING } from '../../../common/constants';

interface Pagination {
pageSize: number;
Expand Down Expand Up @@ -77,7 +78,9 @@ export function useTable(storageKey: string) {
);

// get initial state from localStorage
const [sorting, setSorting] = useState<Sorting>(storageData.sort || { sort: {} });
const [sorting, setSorting] = useState<Sorting>(
storageData.sort || { sort: { field: 'name', direction: EUI_SORT_ASCENDING } }
);

const [query, setQuery] = useState('');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const ItemTemplate: React.FC<ItemTemplateProps> = (props) => {
},
{
id: 'advanced',
testSubj: 'esItemDetailAdvancedLink',
label: i18n.translate('xpack.monitoring.esItemNavigation.advancedLinkText', {
defaultMessage: 'Advanced',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h1 class="euiTitle euiTitle--xsmall">{{pageTitle || monitoringMain.instance}}</
</a>
<a
ng-if="monitoringMain.instance && (monitoringMain.name === 'nodes' || monitoringMain.name === 'indices')"
data-test-subj="esNodeDetailAdvancedLink"
data-test-subj="esItemDetailAdvancedLink"
kbn-href="#/elasticsearch/{{ monitoringMain.name }}/{{ monitoringMain.resolver }}/advanced"
class="euiTab"
ng-class="{'euiTab-isSelected': monitoringMain.page === 'advanced'}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['maps']);
const security = getService('security');

describe('docvalue_fields', () => {
// FLAKY: https://github.com/elastic/kibana/issues/114418
describe.skip('docvalue_fields', () => {
before(async () => {
await security.testUser.setRoles(['global_maps_read', 'test_logstash_reader'], false);
await PageObjects.maps.loadSavedMap('document example');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function MonitoringElasticsearchNodeDetailProvider({ getService }) {

return new (class ElasticsearchNodeDetail {
async clickAdvanced() {
return testSubjects.click('esNodeDetailAdvancedLink');
return testSubjects.click('esItemDetailAdvancedLink');
}

async getSummary() {
Expand Down

0 comments on commit 99500f3

Please sign in to comment.