Skip to content

Commit

Permalink
[Log Explorer] Update serverless tests stability (elastic#167482)
Browse files Browse the repository at this point in the history
## 📓 Summary

Update login logic, sorting and search algorithm to stabilize the flaky
tests for Log Explorer.

Closes elastic#165915
Closes elastic#165916 
Closes elastic#165975  
Closes elastic#166016 
Closes elastic#166672 
Closes elastic#166675 
Closes elastic#166817 
Closes elastic#167058
Closes elastic#167189 
Closes elastic#167499 
Closes elastic#167515  
Closes elastic#167562 
Closes elastic#167567 
Closes elastic#167621 
Closes elastic#167664 
Closes elastic#167773

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
3 people authored and dej611 committed Oct 17, 2023
1 parent d5cede6 commit fbf1d04
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export const createDataViewsStateMachine = ({
const searchParams = context.search;
return context.cache.has(searchParams)
? Promise.resolve(context.cache.get(searchParams))
: dataViews.getIdsWithTitle().then((views) => views.map(parseDataViewListItem));
: dataViews
.getIdsWithTitle()
.then((views) => views.map(parseDataViewListItem))
.then((views) => searchDataViews(views, searchParams));
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
export const createPureDatasetsStateMachine = (
initialContext: DefaultDatasetsContext = DEFAULT_CONTEXT
) =>
/** @xstate-layout N4IgpgJg5mDOIC5QBECGAXVBldAnMqAtrAHQCuAdgJbXpWoA2VAXpAMQAyA8gILID6yHgBUe-LMIBKAUR4BZLAG0ADAF1EoAA4B7WFTraKGkAA9EAdmUBWEuYCMygJwBmc1YA0IAJ6IATFeUSO3NHewAOZWCrczC7XwBfeM80TBx8IlIGbVQIGig2CEMwEhoAN20Aa2KU7DwCYhIsnLyEMu0AYwwqQxVVXuMdPQMjJFMLO0dbOzC3Tx8EWJIA5WVnayiYuMTkjFr0hqbcinywXFxtXBJNBgwAMwvCEhq0+szso6hWinLO4d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h8J0eJsyOBnnMxjsFmW5m8JjsnhshOJWzJuwpLCpvEZ-GEom+8g5XW5iAMEiMsL5NnhWMChkCksxeB0NkC4MVCz0nj5OnVGwepNSjEptIZPENLJNIF+5p6QLlEl8ljsCvCEjlC0lXr0sosiNhqokapiRODJO24d1+ujzONbJ+Zv+FuB8LTegz0qzOaR7kQVk8AsFgQM03HJitUQrGvwEDAACMFMQ6mABGBUPs6gALdLzilCan0g2N1kyFudNtJxA2cF4QJ2KbdsKQq0uwfA++zfwihxYgigZzlWiSLiua4bluO77rsh6aLAmDoDkqAXMh+wABR6OCACUDDzng4GrkQ66btue4HqBsBxgmN6An0RimBYVi2A4Th5nCvhyrY8yeOEKoEiB8TVlqUAAGKoCQVCMFSQisBwZ5Ghe7LXlyt7AqCeDgpC0IenCCIDhMXpGNmdhmKiegmIEL56NEFZEAoi7wD084qZyAK9AgAC0OiSj5QbCYkxBkH81B0JAbmJvRkwGAWcr3jYJjWjYGJ2C4X7TFp4LgiqIIToKJgBZsjxVLskV0Z5uL8kEfgpYY-o2BKX5PiZBgYiliWNRIHqzusgUlYuEDlWp0WepK5hOlptjTcs07deWfXFYRy7EaR0EUXBVHDR5QKWamQpWW1VndUErptcY-gGPoyp8osfJFSG2zpBJUkRVe7ntnY3YjsqCJTAYcqovMrpingaIYo4V0pXx912UAA */
createMachine<DatasetsContext, DatasetsEvent, DatasetsTypestate>(
{
context: initialContext,
Expand All @@ -44,6 +44,13 @@ export const createPureDatasetsStateMachine = (
},
onError: 'loadingFailed',
},
on: {
SEARCH_DATASETS: 'debounceSearchingDatasets',
SORT_DATASETS: {
target: 'loading',
actions: 'storeSearch',
},
},
},
loaded: {
on: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const createPureIntegrationsStateMachine = (
) =>
createMachine<IntegrationsContext, IntegrationsEvent, IntegrationTypestate>(
{
/** @xstate-layout N4IgpgJg5mDOIC5QEkB2AXMUBOBDdAlgPaqwB0ArqgdYbgDY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TQUAGK4AQiYQKwJGphmL54Yu0VlqbKlPC8H2fEeyq-HzVhBsloL2Cq8FGBoPiwqgRBjvA1xKybL0qapjpJWt2kDK4egnoZzSqbB7NimlAyKqG7he9qVA0HcDBmCQFPszYuOVmjGFLkLP4lcXDvBshqDuqEjggKLo8I8SUfh-DrNzHQrsJTvTkKNOsrtlpKh-p3O8qChr1Avi-a+Ok776UfglBQQo+hPG+EQ-kYN25CW1OTCciZqFm2GrIBQypUqcCgkGWCmV9zOF5JfRUHNlBODbrZfhlCfbVWCm5ERKk9CvDkKlbQDpVCyJYs0EEpciryjlHKRul5NHlWQVDNOAdM4KxPpRKelYPRkAMnRH4LsQZGB9E2MghgQyaCbJCBBydyYywzvLYOWjSB53VkfGKZ9-GDCifYVoHwvT8lBBKTQY1OLNgdJ6RQshnAUOQVEHufdgG+NyTRC8bhAkfDCYGVQdSrGIBVElJsnhHSV0DGoXeXggA */
context: initialContext,
preserveActionOrder: true,
predictableActionArguments: true,
Expand All @@ -45,6 +45,13 @@ export const createPureIntegrationsStateMachine = (
},
onError: 'loadingFailed',
},
on: {
SEARCH_INTEGRATIONS: 'loaded.debounceSearchingIntegrations',
SORT_INTEGRATIONS: {
target: '#loading',
actions: 'storeSearch',
},
},
},
loaded: {
id: 'loaded',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import expect from '@kbn/expect';
import rison from '@kbn/rison';
import querystring from 'querystring';
import { FtrProviderContext } from '../../ftr_provider_context';

const defaultLogColumns = ['@timestamp', 'service.name', 'host.name', 'message'];
Expand All @@ -33,24 +32,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it("should initialize the table columns to logs' default selection", async () => {
await PageObjects.observabilityLogExplorer.navigateTo();

await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();

await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql(defaultLogColumns);
});
});

it('should restore the table columns from the URL state if exists', async () => {
await PageObjects.observabilityLogExplorer.navigateTo({
search: querystring.stringify({
search: {
_a: rison.encode({
columns: ['service.name', 'host.name', 'message', 'data_stream.namespace'],
}),
}),
},
});

await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();

await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql([
...defaultLogColumns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import expect from '@kbn/expect';
import rison from '@kbn/rison';
import querystring from 'querystring';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
Expand All @@ -30,9 +29,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const azureActivitylogsIndex =
'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA===';
await PageObjects.observabilityLogExplorer.navigateTo({
search: querystring.stringify({
search: {
_a: rison.encode({ index: azureActivitylogsIndex }),
}),
},
});

const datasetSelectionTitle =
Expand All @@ -44,9 +43,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should fallback to the "All logs" selection and notify the user of an invalid encoded index', async () => {
const invalidEncodedIndex = 'invalid-encoded-index';
await PageObjects.observabilityLogExplorer.navigateTo({
search: querystring.stringify({
search: {
_a: rison.encode({ index: invalidEncodedIndex }),
}),
},
});

const datasetSelectionTitle =
Expand All @@ -67,10 +66,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const azureActivitylogsIndex =
'BQZwpgNmDGAuCWB7AdgLmAEwIay+W6yWAtmKgOQSIDmIAtFgF4CuATmAHRZzwBu8sAJ5VadAFTkANAlhRU3BPyEiQASklFS8lu2kC55AII6wAAgAyNEFN5hWIJGnIBGDgFYOAJgDM5deCgeFAAVQQAHMgdkaihVIA===';
await PageObjects.observabilityLogExplorer.navigateTo({
search: querystring.stringify({
search: {
_a: rison.encode({ index: azureActivitylogsIndex }),
controlPanels: rison.encode({}),
}),
},
});
const azureDatasetSelectionTitle =
await PageObjects.observabilityLogExplorer.getDatasetSelectorButtonText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const initialPackageMap = {
};
const initialPackagesTexts = Object.values(initialPackageMap);

const expectedDataViews = ['logstash-*', 'logs-*', 'metrics-*'];
const expectedDataViews = ['logs-*', 'logstash-*', 'metrics-*'];
const sortedExpectedDataViews = expectedDataViews.slice().sort();

const uncategorized = ['logs-gaming-*', 'logs-manufacturing-*', 'logs-retail-*'];
Expand All @@ -30,8 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const noIntegrationsTitle = 'No integrations found';
const noUncategorizedTitle = 'No data streams found';

// Failing: See https://github.com/elastic/kibana/issues/167621
describe.skip('Dataset Selector', () => {
describe('Dataset Selector', () => {
before(async () => {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await PageObjects.observabilityLogExplorer.removeInstalledPackages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

it('should navigate to discover keeping the current columns/filters/query/time/data view', async () => {
// Set timerange to specific values to match data and retrieve config
await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();

await retry.try(async () => {
await testSubjects.existOrFail('superDatePickerstartDatePopoverButton');
await testSubjects.existOrFail('superDatePickerendDatePopoverButton');
Expand Down
31 changes: 26 additions & 5 deletions x-pack/test/functional/page_objects/observability_log_explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* 2.0.
*/
import expect from '@kbn/expect';
import rison from '@kbn/rison';
import querystring from 'querystring';
import { WebElementWrapper } from '../../../../test/functional/services/lib/web_element_wrapper';
import { FtrProviderContext } from '../ftr_provider_context';

Expand Down Expand Up @@ -99,6 +101,9 @@ const packages: IntegrationPackage[] = [
const initialPackages = packages.slice(0, 3);
const additionalPackages = packages.slice(3);

const FROM = '2023-08-03T10:24:14.035Z';
const TO = '2023-08-03T10:24:14.091Z';

export function ObservabilityLogExplorerPageObject({
getPageObjects,
getService,
Expand All @@ -109,7 +114,12 @@ export function ObservabilityLogExplorerPageObject({
const testSubjects = getService('testSubjects');
const toasts = getService('toasts');

type NavigateToAppOptions = Parameters<typeof PageObjects['common']['navigateToApp']>[1];
type NavigateToAppOptions = Omit<
Parameters<typeof PageObjects['common']['navigateToApp']>[1],
'search'
> & {
search?: Record<string, string>;
};

return {
uninstallPackage: ({ name, version }: IntegrationPackage) => {
Expand Down Expand Up @@ -172,16 +182,27 @@ export function ObservabilityLogExplorerPageObject({
};
},

async navigateTo(options?: NavigateToAppOptions) {
return await PageObjects.common.navigateToApp('observabilityLogExplorer', options);
async navigateTo(options: NavigateToAppOptions = {}) {
const { search = {}, ...extraOptions } = options;
const composedSearch = querystring.stringify({
...search,
_g: rison.encode({
time: { from: FROM, to: TO },
}),
});

return await PageObjects.common.navigateToApp('observabilityLogExplorer', {
search: composedSearch,
...extraOptions,
});
},

getDatasetSelector() {
return testSubjects.find('datasetSelectorPopover');
},

getDatasetSelectorButton() {
return testSubjects.find('datasetSelectorPopoverButton', 30000); // Increase timeout if refresh takes longer before opening the selector
return testSubjects.find('datasetSelectorPopoverButton', 120000); // Increase timeout if refresh takes longer before opening the selector
},

getDatasetSelectorContent() {
Expand Down Expand Up @@ -290,7 +311,7 @@ export function ObservabilityLogExplorerPageObject({
const searchField = await searchControlsContainer.findByCssSelector('input[type=search]');

await searchField.clearValueWithKeyboard();
return searchField.type(name);
return searchField.type(name, { charByChar: true });
},

async clearSearchField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@
*/
import expect from '@kbn/expect';
import rison from '@kbn/rison';
import querystring from 'querystring';
import { FtrProviderContext } from '../../../ftr_provider_context';

const defaultLogColumns = ['@timestamp', 'service.name', 'host.name', 'message'];

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const retry = getService('retry');
const PageObjects = getPageObjects(['discover', 'observabilityLogExplorer']);
const PageObjects = getPageObjects(['discover', 'observabilityLogExplorer', 'svlCommonPage']);

// FLAKY: https://github.com/elastic/kibana/issues/165915
// FLAKY: https://github.com/elastic/kibana/issues/165916
describe.skip('Columns selection initialization and update', () => {
describe('Columns selection initialization and update', () => {
before(async () => {
await esArchiver.load(
'x-pack/test/functional/es_archives/observability_log_explorer/data_streams'
);
await PageObjects.svlCommonPage.login();
});

after(async () => {
await PageObjects.svlCommonPage.forceLogout();
await esArchiver.unload(
'x-pack/test/functional/es_archives/observability_log_explorer/data_streams'
);
Expand All @@ -35,24 +34,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it("should initialize the table columns to logs' default selection", async () => {
await PageObjects.observabilityLogExplorer.navigateTo();

await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();

await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql(defaultLogColumns);
});
});

it('should restore the table columns from the URL state if exists', async () => {
await PageObjects.observabilityLogExplorer.navigateTo({
search: querystring.stringify({
search: {
_a: rison.encode({
columns: ['service.name', 'host.name', 'message', 'data_stream.namespace'],
}),
}),
},
});

await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage();

await retry.try(async () => {
expect(await PageObjects.discover.getColumnHeaders()).to.eql([
...defaultLogColumns,
Expand Down
Loading

0 comments on commit fbf1d04

Please sign in to comment.