-
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
[tests] increase timeout to allow plugin views to be prepared #8151
Conversation
as well fixes some exceptions caused by disposed widgets Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@@ -404,6 +404,9 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution { | |||
* By default returns with all items where the command is enabled and `item.isVisible` is `true`. | |||
*/ | |||
visibleItems(widget: Widget): Array<TabBarToolbarItem | ReactTabBarToolbarItem> { | |||
if (widget.isDisposed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fo instance in the side bar, the title is still visible, but associated widget is disposed since it is collapsed, with bad timing it can throw in own contributions
if (layout instanceof ViewContainerLayout) { | ||
return layout; | ||
} | ||
throw new Error('view container is disposed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a widget is disposed then layout is null
@@ -1178,6 +1182,10 @@ export class ViewContainerLayout extends SplitLayout { | |||
|
|||
// The update function is called on every animation frame until the predefined duration has elapsed. | |||
const updateFunc = (time: number) => { | |||
if (!this.parent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a widget gets closed during the animation it will throw in MessageLoop.sendMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the tests are still failing locally (which is the case since fdd7c41).
I verified by running the suite 3 times using npx run test @theia/example-browser
.
I am running on Linux (Ubuntu 18.04), but it is also reproducible on Gitpod (which uses Ubuntu 20.04 LTS) when executing the tests.
@vince-fugnitto Could it be that your machine is slow and preparing plugin views takes longer? Gitpod can hit noisy neighbourhood problem then everything is slow. Try to increase timeout and see whether issue is gone or share the output of failed timeouts. |
I increased the timeout for both to Error
|
Your errors are very different, not about timeouts. How do you run test? |
I either do:
or
Both of them fail similarly, is there a specific way I should run the tests? |
No, but I've never seen such errors on travis or in Gitpod. I'm not sure how to reproduce it. I wonder maybe you have something specific locally. |
I ran several times in Gitpod and got once:
will check tomorrow what is wrong whether, but rather than that I could not get other errors I've restarted Travis again to see whether it will fail. |
Maybe someone else could try to run tests as well. I could not reproduce timeouts anymore on travis or my machine :( |
@marcdumais-work I believe you mentioned the tests fail consistently as well for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I performed the following and the tests passed locally for me:
- updated
views
timeout to 15000 - updated
menus
timeout to 15000 - removed any pre-existing configurations
rm -rf ~/.theia
On master, yes. I have not tried this PR. Let me give it a quick try locally and I'll report back. |
@vince-fugnitto IIUC you had to step both timeouts from 7500ms to 15000ms for tests to pass consistently? |
Yes, else they'd fail on a timeout for the explorer mainly. |
I tried it on my computer and the result is:
Fail 1:
Fail 2:
|
I tested this a bit. I still got the occasional failure with both timeouts set at |
@akosyakov in these tests, is an actual browser used? Is data stored in local storage cleared between runs? |
How do you get that? Timeout is 7500ms, not 2000ms. Are you sure you are testing against this PR?
If you do |
Result of tests on my machine(
btw: after tests execution I have modified |
I suggest we merge this PR to fix travis. One has to dive in the rest of errors. It does not seem that Theia behaves the same for all operating systems and machines. I will remove |
It is one which should be installed: https://github.com/eclipse-theia/theia/blob/master/package.json#L39 built-ins should be configured to use the workspace version: Line 55 in 1ca3ec3
I suspect something in your workspace storage under user settings telling buil-in extension to ignore the project settings. |
@akosyakov do you perhaps have the preference value set at the I suspect it may be the reason that different users experience different results when running the suite. |
I found the typescript version can also be set globally in another way. The built-in typescript-language-features creates a memento when the user selects which typescript to use (VS Code's or Workspace's) through the That memento is saved in user storage, under
|
In fact I am not totally sure this setting is global. The memento are in subdirectories that have |
@akosyakov Maybe stupid question, but is there an unstated assumption that one should explicitly select "Use Workspace Version" for TypeScript, at least once? Because once I do this, the setting sticks, but I can't seem to trigger the workspace TypeScript being used otherwise. Or are the workspace configs supposed to be enough for this to happen automatically? P.S.. on Gitpod too, TypeScript |
@vince-fugnitto I wonder how does it work on Travis.
I will need to read the code of the extension again. I am not sure that what is stored in the memento actually affecting the resolution and does not only affect how the quick pick is decorated. |
I'm wrong tests are running from |
@marcdumais-work @vince-fugnitto @RomanNikitenko I've pushed another commit which ensures that a new temp directory is used for user data on each new run of |
064319c
to
fd1bb85
Compare
@akosyakov One little thing I noticed: since these tests open folder |
Is there a reason why you ask? Is it for testing scm support? |
I ran the test using commit fd1bb85 Tested 5 times root INFO 901 passing (2m) |
@lmcbout thanks for testing, I see that this test is failing from time to time too, but could we address it with another PR. I think this PR already has enough improvements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me, it is already a good improvement
No, I was just thinking this state left behind by the suite is a potential source of entropy, that could make the tests behave differently the second time run in an environment and beyond. |
I noticed another potential source of entropy, when running the test suite locally: the test suite uses default port I tried to test this locally, and my "extra" frontend ends-up waiting for user input: |
BTW this is made much less bad now, that the tests do not re-use the user-storage folder ( |
Running locally, the tests now pass a great majority of the time, maybe ~90%. Much improved - thanks @akosyakov ! |
@marcdumais-work You are right there can be other reasons for entropy, but i think we can address them as they come up.
It should be resolved by #7908 It handles user triggered file changes and external differently, so it won't block anymore another window. |
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
fd1bb85
to
c585d6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified the latest changes and the api integration tests pass consistently 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - tests now pass locally much more frequently than before. As suggested, let's start with this and we can further improve as we go.
I tried to look-for a correlation between keeping or deleting that workspace |
What it does
How to test
Review checklist
Reminder for reviewers