diff options
| author | Daniel Hahler <git@thequod.de> | 2019-10-02 04:56:22 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-02 04:56:22 +0200 | 
| commit | 333dc3d1381f5d3c8f0770141c0a989cfff93f57 (patch) | |
| tree | ac78a40460f9aa07700a90bbbf28477292d7be80 /runtime/syntax/ruby.vim | |
| parent | 8e25cf3881bbc3d65645d1b2abc6fa46863b1765 (diff) | |
| download | rneovim-333dc3d1381f5d3c8f0770141c0a989cfff93f57.tar.gz rneovim-333dc3d1381f5d3c8f0770141c0a989cfff93f57.tar.bz2 rneovim-333dc3d1381f5d3c8f0770141c0a989cfff93f57.zip | |
Fix flaky test: tui_spec: increase timeout (#11134)
Meant to fix:
    [  ERROR   ] test/functional/terminal/tui_spec.lua @ 925: TUI FocusGained/FocusLost in terminal-mode
    test/functional/ui/screen.lua:587: Row 6 did not match.
    Expected:
      |{1:r}eady $                                           |
      |[Process exited 0]                                |
      |                                                  |
      |                                                  |
      |                                                  |
      |*gained                                            |
      |{3:-- TERMINAL --}                                    |
    Actual:
      |{1:r}eady $                                           |
      |[Process exited 0]                                |
      |                                                  |
      |                                                  |
      |                                                  |
      |*:terminal                                         |
      |{3:-- TERMINAL --}                                    |
    To print the expect() call that would assert the current screen state, use
    screen:snapshot_util(). In case of non-deterministic failures, use
    screen:redraw_debug() to show all intermediate screen states.
    stack traceback:
    	test/functional/ui/screen.lua:587: in function '_wait'
    	test/functional/ui/screen.lua:370: in function 'expect'
    	test/functional/terminal/tui_spec.lua:934: in function <test/functional/terminal/tui_spec.lua:925>
I've thought about adding this, but it might not be really relevant, and
slows down the tests a bit (and a warning "warning: Screen test
succeeded immediately" with another test):
```diff
diff --git i/test/functional/terminal/tui_spec.lua w/test/functional/terminal/tui_spec.lua
index ada073c4e..4bc2ab4e0 100644
--- i/test/functional/terminal/tui_spec.lua
+++ w/test/functional/terminal/tui_spec.lua
@@ -818,6 +818,11 @@ describe('TUI FocusGained/FocusLost', function()
       ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]')
     feed_data(":autocmd FocusGained * echo 'gained'\n")
     feed_data(":autocmd FocusLost * echo 'lost'\n")
+    -- Wait for autocommand to be registered.
+    retry(nil, nil, function()
+      feed_data(":autocmd FocusLost\n")
+      screen:expect{any="         echo 'lost'"}
+    end)
     feed_data("\034\016")  -- CTRL-\ CTRL-N
   end)
```
Diffstat (limited to 'runtime/syntax/ruby.vim')
0 files changed, 0 insertions, 0 deletions
