-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Failing test: Chrome X-Pack Observability UI Functional Tests.x-pack/test/observability_functional/apps/observability/pages/overview/alert_table·ts - ObservabilityApp Observability overview Without alerts navigate and open alerts section #140507
Comments
New failure: CI Build - main |
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
@maryam-saeidi looks like this test is failing already and was added in #140024, going to skip, would you mind checking out the flakiness of this? |
/skip |
Skipped main: 30af54d |
New failure: CI Build - main |
@spalger Sure, I'll check it. |
Result of first round of investigation: I’ve added a log in the else section to see what is the response in case a test fails and we end up there: Here is the result in the log for one of the failed functional test: (after selecting log for a failed test, search for
So it is not a complete response based on this condition:
And it is also not a failure based on this condition:
Hence ending up in else branch. Now I am checking the meaning of |
When I removed disabling loading from else, the test failed less (only 1 in 10) and in the failed test see this log:
So it seems like a complete response, the question now is why in the screenshot, we still have a loading without alerts table: It's good to know that the API debug log happens at |
When I was checking other alerts table functional tests, I noticed that they are fine and this issue only happens for the overview page, which the difference is having the table in an accordion 😕 After discussing it with @XavierM, he had 2 proposals to check:
For 1, I don't think that would be an issue, because, in the snapshot, we still see the loading state, so other parts of the table will not be visible. Also, I remember, I had an issue with the test failing so I added the step to check if loading is still there, so this step was added because of the failure. For 2, I changed the code to always have the accordion open and see what will happen in that case, and now tests are passing 🤯 (https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1244) |
I can't imagine option 1 helping since the test is failing after 30 seconds and then accordion is still loading. Last time we talked we assumed that there was some flaw in the UI that lead to the accordion never exiting the loading state in some cases, have you proved that isn't the case @maryam-saeidi? Maybe we can just try extending the timeout to 2 minutes? If the test still fails I really don't think it's the test and the two solutions you've proposed are implying that the problem is with the tests, not the UI. |
@spalger yes, I've added a log based on our discussion and based on the screenshot here, it seems we fetch the data correctly in the failed test but the loading is still there even after 30 secs. The strange part is, the tests are passing when we load the table at the page load time but if we put the table in accordion and the accordion is closed at the page load time, then we have the flaky test after opening the accordion. 😖 |
Still sounds like a UI issue to me, one that users are likely to encounter in conditions similar to CI |
When I logged the |
Nice find @maryam-saeidi! Have you inspected all the places where the |
There is only one place, I've added more logs to see whether I can identify what change causes extra loading for the component. |
Sounds to me like maybe a |
Ah, that would be great, here you can find the 2 files that I've added logs for debugging:
|
@maryam-saeidi Ok, I think I found it: https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/use_fetch_alerts.tsx#L175-L176 If I think if we move the |
@spalger Wow, interesting! Let me give it a try. |
@spalger unfortunately, it still has the same issue. (flaky test runner) The most confusing part is the fact that the issue only happens when the alerts table is in an accordion which is closed at the start. So I am wondering what is different in the initially hidden state that causes this issue. |
I'm pretty sure that when the accordion is hidden the content isn't rendered, so the primary change is that the content is being rendered some time after the page was rendered, but something it's happening a little later and sometimes it's happening a little sooner based on the speed of selenium opening the accordion. Either way, I think focusing on how the loading state is shown, and tracking back to how that is occurring, is the most fruitful path to follow. I realized I had stopped looking for how the loading state is represented when I saw the Lines 300 to 302 in b854cd8
The other variable used there, Line 27 in d5dd241
In that hook it looks like we have another case where an error will cause the component to always be in a "loading" state. Do we have any insight into how that hook is working? |
|
Okay, but that doesn't change the fact that the component is rendering a loading component indefinitely so the answer is in the logic somewhere... |
Yes, I see your point. I will check it later this week and keep you posted about the result. |
It seems this fix also solved the flaky test issue. Flaky test runner:
I am still curious why the second request is not getting any response but I think the fix is avoiding this second request since the time hasn't been changed, so the second request should not trigger the re-fetching as it was stated here. |
…#145828) Fixes #140507 This issue was fixed in the refactoring that I've done [here](https://github.com/elastic/kibana/pull/143840/files#diff-ab4cbe22bf9a1c9bbaf3a3cb32b5aa5b0c8b8e33c34b88ed3c99dbde6fedadb9L236). Now we only send request when a filter changes not on every render. (More info in the ticket) [Flaky test runner link](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds?branch=refs%2Fpull%2F145828%2Fhead)
A test failed on a tracked branch
First failure: CI Build - main
The text was updated successfully, but these errors were encountered: