-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[playwright] Flaky Playwright test in theia-explorer-view.test.ts:56:9
#12063
Comments
The `theia-workspace.test.ts` checks for existence of file nodes in the explorer view to verify whether the workspace has been prepared correctly. However, occasionally it may happen that the explorer view doesn't show them yet, as the files are just being loaded. This resulted in occasionally flaky test executions (eclipse-theia#12063). To fix this problem, we now use the `existsDirectoryNode` and `existsFileNode` checks to explicitly wait for them to appear and only fail if the check times out. Contributed on behalf of STMicroelectronics. Fixes eclipse-theia#12063 Change-Id: I4226a7d6f657c6a1363160655da4c94cd0984379
The `theia-workspace.test.ts` checks for existence of file nodes in the explorer view to verify whether the workspace has been prepared correctly. However, occasionally it may happen that the explorer view doesn't show them yet, as the files are just being loaded. This resulted in occasionally flaky test executions (#12063). To fix this problem, we now use the `existsDirectoryNode` and `existsFileNode` checks to explicitly wait for them to appear and only fail if the check times out. Contributed on behalf of STMicroelectronics. Fixes #12063 Change-Id: I4226a7d6f657c6a1363160655da4c94cd0984379
I noticed this issue has been re-happening recently [1]. I tried the Playwright tests locally for the first time and was lucky that I was able to reproduce the failure rather consistently [2]. I will be posting a PR shortly to try to improve the flaky tests I was able to troubleshoot locally. @planger I would appreciate your review on it. I think you had the correct idea in your related recent PR, but the same issue is happening in other test cases too, so I went with a fix in the test infrastructure. More details in the PR. [1]: e.g.: [2]: Way more so that in our CI, which passes most of the time. This suite seems extremely sensitive to timing - t some point I tried adding some entropy by running `stress -c 1 -m 1" during the Playwright tests and the failures went away until I stopped :) |
This is an attempt at solidifying the playwright test suite, that has had testcases intermitently failing. I have been lucky to be able to observe some race conditions rather consistently locally, and so be able to debug them and solidify against them. The race conditions are very slight - the Playwright test suite takes a screenshot at every failure, and consistently I see the correct state on those, meaning that the state is what it should be, by the time the screenshot is taken. In consequence, I wound that, for a given flaky scenario, addressing one race consition would often mask a second one, present in the same scenario. It's possible that under a different execution context, more race conditions would occur. Here are the race coditions I have found: - When the Theia explorer view is created (at frontend reload or when explicitly closed and then re-opened in a test case), it can take some time for its file nodes to appear in the UI. Some tests were assuming that once the view was visible, they would be too. - Similarly, it can take some time for the Explorer's view tab to be created, after the view is. Some test cases were checking immediately for the view tab being visible, and failing when it was not. - Also related to the explorer view, method "selectTreeNode" was used to select a file node and assumed that it would be selected imemdiately after clicking on it. closes #12063 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
This is an attempt at solidifying the playwright test suite, that has had testcases intermitently failing. I have been lucky to be able to observe some race conditions rather consistently locally, and so be able to debug them and solidify against them. The race conditions are very slight - the Playwright test suite takes a screenshot at every failure, and consistently I see the correct state on those, meaning that the state is what it should be, by the time the screenshot is taken. In consequence, I wound that, for a given flaky scenario, addressing one race consition would often mask a second one, present in the same scenario. It's possible that under a different execution context, more race conditions would occur. Here are the race coditions I have found: - When the Theia explorer view is created (at frontend reload or when explicitly closed and then re-opened in a test case), it can take some time for its file nodes to appear in the UI. Some tests were assuming that once the view was visible, they would be too. - Similarly, it can take some time for the Explorer's view tab to be created, after the view is. Some test cases were checking immediately for the view tab being visible, and failing when it was not. - Also related to the explorer view, in at least one testcase, method "selectTreeNode" was used to select a file node and assumed that it would be selected immediately after clicking on it. closes #12063 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
This is an attempt at solidifying the playwright test suite, that has had testcases intermitently failing. I have been lucky to be able to observe some race conditions rather consistently locally, and so be able to debug them and solidify against them. The race conditions are very slight - the Playwright test suite takes a screenshot at every failure, and consistently I see the correct state on those, meaning that the state is what it should be, by the time the screenshot is taken. In consequence, I wound that, for a given flaky scenario, addressing one race consition would often mask a second one, present in the same scenario. It's possible that under a different execution context, more race conditions would occur. Here are the race coditions I have found: - When the Theia explorer view is created (at frontend reload or when explicitly closed and then re-opened in a test case), it can take some time for its file nodes to appear in the UI. Some tests were assuming that once the view was visible, they would be too. - Similarly, it can take some time for the Explorer's view tab to be created, after the view is. Some test cases were checking immediately for the view tab being visible, and failing when it was not. - Also related to the explorer view, in at least one testcase, method "selectTreeNode" was used to select a file node and assumed that it would be selected immediately after clicking on it. closes #12063 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
This is an attempt at solidifying the playwright test suite, that has had testcases intermitently failing. I have been lucky to be able to observe some race conditions rather consistently locally, and so be able to debug them and solidify against them. The race conditions are very slight - the Playwright test suite takes a screenshot at every failure, and consistently I see the correct state on those, meaning that the state is what it should be, by the time the screenshot is taken. In consequence, I wound that, for a given flaky scenario, addressing one race consition would often mask a second one, present in the same scenario. It's possible that under a different execution context, more race conditions would occur. Here are the race coditions I have found: - When the Theia explorer view is created (at frontend reload or when explicitly closed and then re-opened in a test case), it can take some time for its file nodes to appear in the UI. Some tests were assuming that once the view was visible, they would be too. - Similarly, it can take some time for the Explorer's view tab to be created, after the view is. Some test cases were checking immediately for the view tab being visible, and failing when it was not. - Also related to the explorer view, in at least one testcase, method "selectTreeNode" was used to select a file node and assumed that it would be selected immediately after clicking on it. closes #12063 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
This is an attempt at solidifying the playwright test suite, that has had testcases intermitently failing. I have been lucky to be able to observe some race conditions rather consistently locally, and so be able to debug them and solidify against them. The race conditions are very slight - the Playwright test suite takes a screenshot at every failure, and consistently I see the correct state on those, meaning that the state is what it should be, by the time the screenshot is taken. In consequence, I wound that, for a given flaky scenario, addressing one race consition would often mask a second one, present in the same scenario. It's possible that under a different execution context, more race conditions would occur. Here are the race coditions I have found: - When the Theia explorer view is created (at frontend reload or when explicitly closed and then re-opened in a test case), it can take some time for its file nodes to appear in the UI. Some tests were assuming that once the view was visible, they would be too. - Similarly, it can take some time for the Explorer's view tab to be created, after the view is. Some test cases were checking immediately for the view tab being visible, and failing when it was not. - Also related to the explorer view, in at least one testcase, method "selectTreeNode" was used to select a file node and assumed that it would be selected immediately after clicking on it. closes #12063 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
Bug Description:
As I'm tracking the executions of the Playwright tests and recording their failures continuously, I observed that there is actually only one test in the past four months which fails from time to time (about 3-4 times a month). I didn't observe any other test failing in this time frame.
Thus, I believe it is worth spending some time investigating whether this flaky test can be stabilized.
See below for the output of the flaky test, when it fails:
See also https://github.com/eclipse-theia/theia/actions/runs/3815148923/jobs/6489956895
The text was updated successfully, but these errors were encountered: