Repository navigation
Conversation
vis takes an escape followed by another key within its escape delay (50 ms) as an Alt modifier. keys only slept 100 ms after writing an escape, which is not enough on a loaded machine: vis reads all pending input at once and may still be processing the keys before the escape when the next key arrives. It then reads e.g. <Escape>j as <M-j>, and the test fails. This made the vim comparison tests fail at random on busy build machines, e.g. golf/4fbf8e303be58b0001000024/1 and operators/replace/replace. When writing to a pipe, wait until the editor has read all input before writing an escape, so that the escape is read on its own, and again after it, before sleeping. The waits use FIONREAD and are bounded, so an editor that died cannot hang the test. Where FIONREAD does not report unread data, nothing changes. With four busy loops pinned to the same CPU as vis, the golf test failed in 10 out of 10 runs before and passed in 20 out of 20 after. Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vis takes an escape followed by another key within its escape delay (50 ms) as an Alt modifier. keys only slept 100 ms after writing an escape, which is not enough on a loaded machine: vis reads all pending input at once and may still be processing the keys before the escape when the next key arrives. It then reads e.g. j as , and the test fails. This made the vim comparison tests fail at random on busy build machines, e.g. golf/4fbf8e303be58b0001000024/1 and operators/replace/replace.
When writing to a pipe, wait until the editor has read all input before writing an escape, so that the escape is read on its own, and again after it, before sleeping. The waits use FIONREAD and are bounded, so an editor that died cannot hang the test. Where FIONREAD does not report unread data, nothing changes.
With four busy loops pinned to the same CPU as vis, the golf test failed in 10 out of 10 runs before and passed in 20 out of 20 after.