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

fix #5181 #5182

Merged
merged 6 commits into from
Oct 14, 2024
Merged

fix #5181 #5182

merged 6 commits into from
Oct 14, 2024

Conversation

jerch
Copy link
Member

@jerch jerch commented Oct 4, 2024

See #5181.

@jerch jerch requested a review from Tyriar October 4, 2024 15:57
@jerch jerch added this to the 6.0.0 milestone Oct 4, 2024
@@ -163,43 +163,51 @@ test.describe('ImageAddon', () => {
test('testdata default (scrolling with VT240 cursor pos)', async () => {
const dim = await getDimensions();
await ctx.proxy.write(SIXEL_SEQ_0);
await timeout(50);
Copy link
Member

Choose a reason for hiding this comment

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

The await on write should be fine, no? If not, is there something else we could await that isn't an arbitrary time?

Copy link
Member Author

@jerch jerch Oct 4, 2024

Choose a reason for hiding this comment

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

Sadly nope - we expose no signal/event like thingy, that would correctly mark the end of terminal processing up to the renderer.

My other guess regarding those flaky tests is about term.reset, which gets called over and over in test modules (fixed for web-links tests in the other PR #5180). I am not sure, if this call is fully synchronous now (we even had an issue regarding this in the past) - if not, then heavy load on the CI machine might cause those time offsets with failing tests. Also just a wild guess atm, but with the fix the tests passed.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right, these need rendering to have occurred. This is internal, but you could debounce listen on IRenderService.onRender which is what you're actually after. Alternatively I think we have a pollFor helper where we can set a much larger timeout without impacting test duration to prevent flakiness

I'm not aware of any reset not being sync problems.

Copy link
Member Author

@jerch jerch Oct 5, 2024

Choose a reason for hiding this comment

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

Yes some of them need the actual rendering result, which is a bit cumbersome to follow due to our async writing/rendering. For those tests it is clear, that a busy CI machine will take very long eventually running into a timeout. Thats also the case for weblink tests, as they eval the DOM renderer results.
I will see if I can find a more reliable / deterministic way to wait for render result with onRender.

The issue with reset was brought up in #4603, and your fix kinda addressed a bad interim state of the viewport in sync code. To me this had similarities to the infamous nextTick issue often seen in nodejs tasks, that need eventloop+1 invocations to fully finish.
And sometimes tests on a busy CI machine fail so randomly with a weird error that I started to wonder, if we have such an eventloop+1 issue hidden anywhere. Also I see those types of failures only in integration tests, which made we wonder if terminal life cycling could cause this. Unit tests dont show those type of failures, they kinda only fail with very high timeout on really busy machines (means we got not enough CPU in time).
Ofc integration/playwright tests are much more heavy with their browser engines in the test stack, so it is not clear, if our (test) code has a hidden issue not surfacing on idle machines, or the browser engine simply stopped working somewhere in between.

Edit: Gonna revert 8faf097, it should not have been mixed with the bug being addressed in this PR.

@jerch
Copy link
Member Author

jerch commented Oct 5, 2024

@Tyriar Also gonna revert this change 5623ba6 (made in #5180). Sure it helped yesterday, but if there is really an issue with lifecycling/eventloop+1 in term.reset, it would just hide that.

@jerch
Copy link
Member Author

jerch commented Oct 5, 2024

Eww, the errors are back in the web links tests. This really s*x, as I cannot repro locally.

@jerch
Copy link
Member Author

jerch commented Oct 5, 2024

@Tyriar Since weblink tests now pass with a modified fix, lets keep them for now. Imho we should investigate that separately.

Edit: Created #5184 for that.

@Tyriar Tyriar merged commit f701d07 into xtermjs:master Oct 14, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants