Skip to content
Myr

Add retries to CTRL-R tests to avoid intermittent errors on Travis CI

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- https://travis-ci.org/junegunn/fzf/jobs/659496745#L676 Related #1900

authored by Junegunn Choi · committed by Junegunn Choi · parent baf882a · Browse files · 1 file+12 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−8 removed

  • tests:+12 added−8 removed

1 file+12 added−8 removed

modified:test/test_go.rb+12 added-8 removed
1851 unmodified lines
18521853 def test_ctrl_r_multiline1854 tmux.send_keys 'echo "foo', :Enter, 'bar"', :Enter1855 tmux.until { |lines| lines[-2..-1] == ['foo', 'bar'] }1856 retries do1856 tmux.prepare1857 tmux.send_keys 'C-r'1858 tmux.until { |lines| lines[-1] == '>' }1857 tmux.prepare1858 tmux.send_keys 'C-r'1859 tmux.until { |lines| lines[-1] == '>' }1860 end1861 tmux.send_keys 'foo bar'1862 tmux.until { |lines| lines[-3].end_with? 'bar"' }1863 tmux.send_keys :Enter1864 tmux.until { |lines| lines[-1].end_with? 'bar"' }
3 unmodified lines
18681869 def test_ctrl_r_abort1870 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 < 41871 %w[foo ' "].each do |query|1872 retries do1870 tmux.prepare1871 tmux.send_keys(query)1872 tmux.until { |lines| lines[-1].start_with? query }1873 tmux.send_keys 'C-r'1874 tmux.until { |lines| lines[-1] == "> #{query}" }1873 tmux.prepare1874 tmux.send_keys(:Space, 'C-e', 'C-u', query)1875 tmux.until { |lines| lines[-1].start_with? query }1876 tmux.send_keys 'C-r'1877 tmux.until { |lines| lines[-1] == "> #{query}" }1878 end1879 tmux.send_keys 'C-g'1880 tmux.until { |lines| lines[-1].start_with? query }1881 end1882 end
269 unmodified lines