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

[Discover] Unskip Discover-Lens functional test suite #200687

Merged
merged 6 commits into from
Nov 20, 2024
Merged
Changes from 2 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
16 changes: 16 additions & 0 deletions src/plugins/unified_histogram/public/chart/histogram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ export function Histogram({
transform: translate(-50%, -50%);
}
`;
// console.log('histogram', { lensProps, requestData, request, dataView, visContext });
if (
dataView.id &&
(dataView.id !== visContext.requestData.dataViewId ||
(!dataView.isPersisted() && !lensProps.attributes.state.adHocDataViews?.[dataView.id]))
) {
// to prevent a race condition when the data view changes id
// the ids of the data view and the lens props and visContextDataView should be the same
// console.log('flakydebugging', {
// dataViewId: dataView.id,
// visContextDataViewId: visContext.requestData.dataViewId,
// lensProps: lensProps.attributes.references.find((r) => r.id === dataView.id),
// });

return <></>;
Copy link
Member Author

@kertal kertal Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jughosta do we have an alternative here? we need to prevent the rendering for the flaky case, should we render something, given we move forward with this PR (it woulld need to be investigated or refactored later on, since the given state causing the flakiness ideally should not happen)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have an alternative right now. What I've tried was causing other test failures and extra fetches. So let's go with your solution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so we should open an issue to remove this code, given we resolve the root cause, which might be a bigger refactoring

}
Copy link
Member Author

@kertal kertal Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this seems to prevent the history to fail, because we have different data views in different props that are passed into the Lens embeddable. Ideally this should be caught on a higher level, so this kind of situation can't happen. So just display a loading state until props are aligned
However, if this resolves the race condition, it's now clear what's causing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's unskip the test suite and run the flaky test runner too.
I was not able to reproduce the dave view error on this branch!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Thx! This is great news!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, another update to tests would be necessary once you unskip them as in e9d5c25

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests are green, and flaky test runner too


return (
<>
Expand Down