mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
tests: improve robustness of immediate successes in screen tests
This commit is contained in:
@@ -51,25 +51,20 @@ describe("shell command :!", function()
|
||||
end)
|
||||
|
||||
it("throttles shell-command output greater than ~10KB", function()
|
||||
if os.getenv("TRAVIS") and helpers.os_name() == "osx" then
|
||||
pending("[Unreliable on Travis macOS.]", function() end)
|
||||
return
|
||||
end
|
||||
|
||||
screen.timeout = 20000 -- Avoid false failure on slow systems.
|
||||
child_session.feed_data(
|
||||
":!for i in $(seq 2 3000); do echo XXXXXXXXXX $i; done\n")
|
||||
":!for i in $(seq 2 30000); do echo XXXXXXXXXX $i; done\n")
|
||||
|
||||
-- If we observe any line starting with a dot, then throttling occurred.
|
||||
screen:expect{any="\n."}
|
||||
-- Avoid false failure on slow systems.
|
||||
screen:expect{any="\n%.", timeout=20000}
|
||||
|
||||
-- Final chunk of output should always be displayed, never skipped.
|
||||
-- (Throttling is non-deterministic, this test is merely a sanity check.)
|
||||
screen:expect([[
|
||||
XXXXXXXXXX 2997 |
|
||||
XXXXXXXXXX 2998 |
|
||||
XXXXXXXXXX 2999 |
|
||||
XXXXXXXXXX 3000 |
|
||||
XXXXXXXXXX 29997 |
|
||||
XXXXXXXXXX 29998 |
|
||||
XXXXXXXXXX 29999 |
|
||||
XXXXXXXXXX 30000 |
|
||||
|
|
||||
{10:Press ENTER or type command to continue}{1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
|
||||
Reference in New Issue
Block a user