Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Visualize] unskip visualize flaky tests #190249

Merged
merged 8 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions src/plugins/vis_types/vislib/public/vis_wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,32 @@ const VislibWrapper = ({ core, charts, visData, visConfig, handlers }: VislibWra
const visController = useRef<VislibVisController | null>(null);
const skipRenderComplete = useRef<boolean>(true);

const renderComplete = useMemo(
() => () => {
const usageCollection = getUsageCollectionStart();
const containerType = extractContainerType(handlers.getExecutionContext());

if (usageCollection && containerType) {
usageCollection.reportUiCounter(
containerType,
METRIC_TYPE.COUNT,
`render_agg_based_${visConfig!.type}`
);
}
handlers.done();
},
[handlers, visConfig]
);
const renderComplete = useCallback(() => {
if (skipRenderComplete.current) {
return;
}
const usageCollection = getUsageCollectionStart();
const containerType = extractContainerType(handlers.getExecutionContext());

if (usageCollection && containerType) {
usageCollection.reportUiCounter(
containerType,
METRIC_TYPE.COUNT,
`render_agg_based_${visConfig!.type}`
);
}
handlers.done();
skipRenderComplete.current = true;
}, [handlers, visConfig]);

const renderChart = useMemo(
() =>
debounce(() => {
if (visController.current) {
visController.current.render(
visData,
visConfig,
handlers,
skipRenderComplete.current ? undefined : renderComplete
);
visController.current.render(visData, visConfig, handlers, renderComplete);
}
skipRenderComplete.current = true;
}, 100),
[handlers, renderComplete, skipRenderComplete, visConfig, visData]
[handlers, renderComplete, visConfig, visData]
);

const onResize: EuiResizeObserverProps['onResize'] = useCallback(() => {
Expand Down
9 changes: 4 additions & 5 deletions test/functional/apps/visualize/group2/_gauge_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);

// FLAKY: https://github.com/elastic/kibana/issues/181883
describe.skip('gauge chart', function indexPatternCreation() {
describe('gauge chart', function indexPatternCreation() {
before(async () => {
await PageObjects.visualize.initTests();
});
Expand Down Expand Up @@ -57,7 +56,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('gaugePercentageMode');
await testSubjects.setValue('gaugePercentageModeFormatPattern', '0.0%');
await PageObjects.visChart.waitForVisualizationRenderingStabilized();
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(false);

await retry.try(async function tryingForTime() {
const expectedTexts = ['57.3%', 'Average bytes'];
Expand All @@ -77,7 +76,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.selectField('machine.os.raw');
log.debug('Size = 4');
await PageObjects.visEditor.setSize(4);
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(false);
});

it('should show Split Gauges', async () => {
Expand Down Expand Up @@ -113,7 +112,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visEditor.clickBucket('Metric', 'metrics');
await PageObjects.visEditor.selectAggregation('Min', 'metrics');
await PageObjects.visEditor.selectField('bytes', 'metrics');
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(false);

await retry.try(async function tryingForTime() {
const metricValue = await PageObjects.visChart.getGaugeValue();
Expand Down
9 changes: 4 additions & 5 deletions test/functional/apps/visualize/group2/_heatmap_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const inspector = getService('inspector');
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']);

// FLAKY: https://github.com/elastic/kibana/issues/181884
describe.skip('heatmap chart', function indexPatternCreation() {
describe('heatmap chart', function indexPatternCreation() {
const vizName1 = 'Visualization HeatmapChart';
let isNewChartsLibraryEnabled = false;

Expand All @@ -38,7 +37,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('Field = @timestamp');
await PageObjects.visEditor.selectField('@timestamp');
// leaving Interval set to Auto
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled);
});

it('should save and load', async function () {
Expand Down Expand Up @@ -97,7 +96,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should show 6 color ranges if changed on options', async function () {
await PageObjects.visEditor.clickOptionsTab();
await PageObjects.visEditor.changeHeatmapColorNumbers(6);
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled);
await PageObjects.visChart.waitForVisualizationRenderingStabilized();

const legends = await PageObjects.visChart.getLegendEntries();
Expand Down Expand Up @@ -138,7 +137,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
log.debug('customize 2 last ranges');
await PageObjects.visEditor.setCustomRangeByIndex(6, '650', '720');
await PageObjects.visEditor.setCustomRangeByIndex(7, '800', '905');
await PageObjects.visEditor.clickGo();
await PageObjects.visEditor.clickGo(isNewChartsLibraryEnabled);

await PageObjects.visChart.waitForVisualizationRenderingStabilized();
const legends = await PageObjects.visChart.getLegendEntries();
Expand Down
2 changes: 2 additions & 0 deletions test/functional/page_objects/visualize_editor_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export class VisualizeEditorPageObject extends FtrService {
await this.elasticChart.setNewChartUiDebugFlag();
}

await this.common.sleep(500); // wait for the visualization to render

const prevRenderingCount = await this.visChart.getVisualizationRenderingCount();
this.log.debug(`Before Rendering count ${prevRenderingCount}`);
await this.testSubjects.clickWhenNotDisabledWithoutRetry('visualizeEditorRenderButton');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const elasticChart = getService('elasticChart');

// Failing: See https://github.com/elastic/kibana/issues/181895
describe.skip('Gauge', function describeIndexTests() {
describe('Gauge', function describeIndexTests() {
const isNewChartsLibraryEnabled = true;

before(async () => {
Expand Down