Skip to content

Commit

Permalink
Qemu: detect in tests and have longer timeout, skip a few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Sep 10, 2023
1 parent 39d4550 commit ab3d9cf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ jobs:
make -j$(getconf _NPROCESSORS_ONLN)
./vim --version
cd testdir
export CI_QEMU=1
make
popd
2 changes: 1 addition & 1 deletion src/testdir/runtest.vim
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func RunTheTest(test)
" No test should take longer than 30 seconds. If it takes longer we
" assume we are stuck and need to break out.
let test_timeout_timer =
\ timer_start(RunningWithValgrind() ? 50000 : 30000, 'TestTimeout')
\ timer_start(RunningSlow() ? 50000 : 30000, 'TestTimeout')
let g:timeout_start = localtime()
endif

Expand Down
4 changes: 4 additions & 0 deletions src/testdir/shared.vim
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func RunningWithValgrind()
return GetVimCommand() =~ '\<valgrind\>'
endfunc

func RunningSlow()
return RunningWithValgrind() || !empty($CI_QEMU)
endfunc

" Get the command to run Vim, with --clean instead of "-u NONE".
func GetVimCommandClean()
let cmd = GetVimCommand()
Expand Down
3 changes: 2 additions & 1 deletion src/testdir/term_util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ endfunc
func StopVimInTerminal(buf, kill = 1)
" Using a terminal to run Vim is always considered flaky.
let g:test_is_flaky = 1
let timeout = RunningSlow() ? 5000 : 20000

call assert_equal("running", term_getstatus(a:buf))

Expand All @@ -162,7 +163,7 @@ func StopVimInTerminal(buf, kill = 1)
call TermWait(a:buf)

" Wait for the terminal to end.
call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))})
call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))}, timeout)

" If the buffer still exists forcefully wipe it.
if a:kill && bufexists(a:buf)
Expand Down
4 changes: 3 additions & 1 deletion src/testdir/test_crypt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ endfunc

func Test_uncrypt_xchacha20v2_custom()
CheckFeature sodium
CheckArch s390x
for arch in ['s390x', 'aarch64', 'riscv64']
exe "CheckArch " .. arch
endfor
" Test, reading xchacha20v2 with custom encryption parameters
let hex =<< trim END
00000000: 5669 6d43 7279 7074 7e30 3521 934b f288 VimCrypt~05!.K..
Expand Down

0 comments on commit ab3d9cf

Please sign in to comment.