Skip to content

Commit e366ed4

Browse files
committed
patch 8.2.5136: debugger test fails when run with valgrind
Problem: Debugger test fails when run with valgrind. Solution: Wait longer when using valgrind.
1 parent 0f0d3a7 commit e366ed4

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/testdir/shared.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ func GetVimCommand(...)
288288
return cmd
289289
endfunc
290290

291+
" Return one when it looks like the tests are run with valgrind, which means
292+
" that everything is much slower.
293+
func RunningWithValgrind()
294+
return GetVimCommand() =~ '\<valgrind\>'
295+
endfunc
296+
291297
" Get the command to run Vim, with --clean instead of "-u NONE".
292298
func GetVimCommandClean()
293299
let cmd = GetVimCommand()

src/testdir/test_debugger.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def Test_Debugger_breakadd_vim9_expr()
408408

409409
# Start Vim in a terminal
410410
var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
411-
call g:TermWait(buf)
411+
call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50)
412412

413413
# Despite the failure the functions are defined
414414
g:RunDbgCmd(buf, ':function g:EarlyFunc',
@@ -434,7 +434,7 @@ def Test_Debugger_break_at_return()
434434

435435
# Start Vim in a terminal
436436
var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
437-
call g:TermWait(buf)
437+
call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50)
438438

439439
g:RunDbgCmd(buf, ':call GetNum()',
440440
['line 1: return 1 + 2 + 3'], {match: 'pattern'})

src/testdir/test_search.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ func Test_searchpair_timeout_with_skip()
374374
let ms = 1
375375
let min_time = 0.001
376376
let max_time = min_time * 10.0
377-
if GetVimCommand() =~ 'valgrind.*--log-file='
377+
if RunningWithValgrind()
378378
let max_time += 0.04 " this can be slow with valgrind
379379
endif
380380
endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
5136,
737739
/**/
738740
5135,
739741
/**/

0 commit comments

Comments
 (0)