diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-07 19:56:06 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2020-03-07 19:56:06 +0900 |
commit | 7c40a424c0bf5a8967816d51ead6a71a334f30bb (patch) | |
tree | a2063567505ada25f048c2bd64b202e9f5d118ff | |
parent | baf882ace741e4d279b6a6d2da467e00f94642f5 (diff) |
Add retries to CTRL-R tests to avoid intermittent errors on Travis CI
- https://travis-ci.org/junegunn/fzf/jobs/659496745#L676
Related #1900
-rwxr-xr-x | test/test_go.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/test_go.rb b/test/test_go.rb index d539658c..fa4a6ef9 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -1853,9 +1853,11 @@ module TestShell def test_ctrl_r_multiline tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter tmux.until { |lines| lines[-2..-1] == ['foo', 'bar'] } - tmux.prepare - tmux.send_keys 'C-r' - tmux.until { |lines| lines[-1] == '>' } + retries do + tmux.prepare + tmux.send_keys 'C-r' + tmux.until { |lines| lines[-1] == '>' } + end tmux.send_keys 'foo bar' tmux.until { |lines| lines[-3].end_with? 'bar"' } tmux.send_keys :Enter @@ -1867,11 +1869,13 @@ module TestShell def test_ctrl_r_abort skip "doesn't restore the original line when search is aborted pre Bash 4" if shell == :bash && /(?<= version )\d+/.match(`#{Shell.bash} --version`).to_s.to_i < 4 %w[foo ' "].each do |query| - tmux.prepare - tmux.send_keys(query) - tmux.until { |lines| lines[-1].start_with? query } - tmux.send_keys 'C-r' - tmux.until { |lines| lines[-1] == "> #{query}" } + retries do + tmux.prepare + tmux.send_keys(:Space, 'C-e', 'C-u', query) + tmux.until { |lines| lines[-1].start_with? query } + tmux.send_keys 'C-r' + tmux.until { |lines| lines[-1] == "> #{query}" } + end tmux.send_keys 'C-g' tmux.until { |lines| lines[-1].start_with? query } end |