Skip to content

Commit

Permalink
[8.8] [TSVB] Remove flakiness on resetPage (#156484) (#156676)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.8`:
- [[TSVB] Remove flakiness on resetPage
(#156484)](#156484)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-04T09:33:29Z","message":"[TSVB]
Remove flakiness on resetPage (#156484)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/156457\r\nCloses
https://github.com/elastic/kibana/issues/156452\r\nCloses
https://github.com/elastic/kibana/issues/156439\r\nCloses
https://github.com/elastic/kibana/issues/156400\r\nCloses
https://github.com/elastic/kibana/issues/156599\r\nCloses
https://github.com/elastic/kibana/issues/156502\r\nCloses
https://github.com/elastic/kibana/issues/156501\r\n\r\nthe resetPage
function is creating this flakiness. I cant figure out why\r\nbut is on
the navigateToUrl function. Sometimes it reports #create
and\r\nsometimes without the hash. The navigateToUrl is not needed as it
is\r\nalready done on another function. The only thing that is needed is
the\r\nsetTimePicker function.\r\n\r\nFlaky runer (100
times)\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2210","sha":"e5f6f96e9cd365fd8ae8e7f250ab3d67f56514f3","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:TSVB","Team:Visualizations","release_note:skip","backport:skip","v8.9.0"],"number":156484,"url":"https://github.com/elastic/kibana/pull/156484","mergeCommit":{"message":"[TSVB]
Remove flakiness on resetPage (#156484)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/156457\r\nCloses
https://github.com/elastic/kibana/issues/156452\r\nCloses
https://github.com/elastic/kibana/issues/156439\r\nCloses
https://github.com/elastic/kibana/issues/156400\r\nCloses
https://github.com/elastic/kibana/issues/156599\r\nCloses
https://github.com/elastic/kibana/issues/156502\r\nCloses
https://github.com/elastic/kibana/issues/156501\r\n\r\nthe resetPage
function is creating this flakiness. I cant figure out why\r\nbut is on
the navigateToUrl function. Sometimes it reports #create
and\r\nsometimes without the hash. The navigateToUrl is not needed as it
is\r\nalready done on another function. The only thing that is needed is
the\r\nsetTimePicker function.\r\n\r\nFlaky runer (100
times)\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2210","sha":"e5f6f96e9cd365fd8ae8e7f250ab3d67f56514f3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156484","number":156484,"mergeCommit":{"message":"[TSVB]
Remove flakiness on resetPage (#156484)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/156457\r\nCloses
https://github.com/elastic/kibana/issues/156452\r\nCloses
https://github.com/elastic/kibana/issues/156439\r\nCloses
https://github.com/elastic/kibana/issues/156400\r\nCloses
https://github.com/elastic/kibana/issues/156599\r\nCloses
https://github.com/elastic/kibana/issues/156502\r\nCloses
https://github.com/elastic/kibana/issues/156501\r\n\r\nthe resetPage
function is creating this flakiness. I cant figure out why\r\nbut is on
the navigateToUrl function. Sometimes it reports #create
and\r\nsometimes without the hash. The navigateToUrl is not needed as it
is\r\nalready done on another function. The only thing that is needed is
the\r\nsetTimePicker function.\r\n\r\nFlaky runer (100
times)\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2210","sha":"e5f6f96e9cd365fd8ae8e7f250ab3d67f56514f3"}}]}]
BACKPORT-->
  • Loading branch information
stratoula authored May 4, 2023
1 parent e882faa commit ea74fc3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
6 changes: 3 additions & 3 deletions test/functional/apps/visualize/group4/_tsvb_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
await visualBuilder.checkVisualBuilderIsPresent();
await visualBuilder.resetPage();
await visualBuilder.setTime();
});

describe('metric', () => {
Expand Down Expand Up @@ -430,7 +430,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('switch panel interval test', () => {
beforeEach(async () => {
await visualBuilder.resetPage();
await visualBuilder.setTime();
await visualBuilder.clickMetric();
await visualBuilder.checkMetricTabIsPresent();
await visualBuilder.clickPanelOptions('metric');
Expand Down Expand Up @@ -551,7 +551,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

beforeEach(async () => {
await visualBuilder.resetPage();
await visualBuilder.setTime();
await visualBuilder.selectAggType('Average');
await visualBuilder.setFieldForAggregation('bytes');
await visualBuilder.setMetricsGroupByTerms('machine.os.raw');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/group5/_tsvb_time_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

describe('Time Series', () => {
beforeEach(async () => {
await visualBuilder.resetPage();
await visualBuilder.setTime();
await visualBuilder.clickPanelOptions('timeSeries');
await visualBuilder.setDropLastBucket(true);
await visualBuilder.clickDataTab('timeSeries');
Expand Down
9 changes: 7 additions & 2 deletions test/functional/apps/visualize/group6/_tsvb_markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('markdown', () => {
before(async () => {
await visualize.initTests();
await visualBuilder.resetPage();
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
await visualBuilder.checkVisualBuilderIsPresent();
await visualBuilder.clickMarkdown();
await timePicker.setAbsoluteRange(
'Sep 22, 2015 @ 06:00:00.000',
Expand Down Expand Up @@ -149,7 +151,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

describe('applying field formats from Advanced Settings for values', () => {
before(async () => {
await visualBuilder.resetPage();
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
await visualBuilder.checkVisualBuilderIsPresent();
await visualBuilder.setTime();
await visualBuilder.clickMarkdown();
await visualBuilder.markdownSwitchSubTab('markdown');
await visualBuilder.enterMarkdown('{{ average_of_bytes.last.formatted }}');
Expand Down
5 changes: 4 additions & 1 deletion test/functional/apps/visualize/group6/_tsvb_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
describe('table', () => {
beforeEach(async () => {
await visualBuilder.resetPage('Sep 22, 2015 @ 06:00:00.000', 'Sep 22, 2015 @ 11:00:00.000');
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
await visualBuilder.checkVisualBuilderIsPresent();
await visualBuilder.setTime('Sep 22, 2015 @ 06:00:00.000', 'Sep 22, 2015 @ 11:00:00.000');
await visualBuilder.clickTable();

await visualBuilder.checkTableTabIsPresent();
Expand Down
7 changes: 5 additions & 2 deletions test/functional/apps/visualize/group6/_tsvb_tsdb_basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { visualBuilder } = getPageObjects(['visualBuilder']);
const { visualBuilder, visualize } = getPageObjects(['visualBuilder', 'visualize']);
const log = getService('log');
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
Expand Down Expand Up @@ -43,7 +43,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});

beforeEach(async () => {
await visualBuilder.resetPage();
await visualize.navigateToNewVisualization();
await visualize.clickVisualBuilder();
await visualBuilder.checkVisualBuilderIsPresent();
await visualBuilder.setTime();
});

it('should render from a tsdb dataView regular fields with no issues', async () => {
Expand Down
9 changes: 8 additions & 1 deletion test/functional/page_objects/visual_builder_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@ export class VisualBuilderPageObject extends FtrService {
this.log.debug('Wait for initializing TSVB editor');
await this.checkVisualBuilderIsPresent();
this.log.debug('Set absolute time range from "' + fromTime + '" to "' + toTime + '"');
await this.timePicker.setAbsoluteRange(fromTime, toTime);
await this.setTime(fromTime, toTime);
// 2 sec sleep until https://github.com/elastic/kibana/issues/46353 is fixed
await this.common.sleep(2000);
}

public async setTime(
fromTime = 'Sep 19, 2015 @ 06:31:44.000',
toTime = 'Sep 22, 2015 @ 18:31:44.000'
) {
await this.timePicker.setAbsoluteRange(fromTime, toTime);
}

public async checkTabIsLoaded(testSubj: string, name: string) {
let isPresent = false;
await this.retry.try(async () => {
Expand Down

0 comments on commit ea74fc3

Please sign in to comment.