Skip to content

Commit 61e3784

Browse files
committed
patch 8.2.5158: TSTP and INT signal tests are not run with valgrind
Problem: TSTP and INT signal tests are not run with valgrind. Solution: Sleep a bit longer. (closes #10614)
1 parent 4e0fc89 commit 61e3784

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

src/testdir/test_signals.vim

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,15 @@ func Test_signal_INT()
8585
throw 'Skipped: INT signal not supported'
8686
endif
8787

88-
" Skip the test when running with valgrind as signal INT is not received
89-
" somehow by Vim when running with valgrind.
90-
let cmd = GetVimCommand()
91-
if cmd =~ 'valgrind'
92-
throw 'Skipped: cannot test signal INT with valgrind'
93-
endif
94-
9588
let buf = RunVimInTerminal('', {'rows': 6})
9689
let pid_vim = term_getjob(buf)->job_info().process
9790

9891
" Check that an endless loop in Vim is interrupted by signal INT.
92+
call term_sendkeys(buf, ":call setline(1, 'running')\n")
9993
call term_sendkeys(buf, ":while 1 | endwhile\n")
10094
call WaitForAssert({-> assert_equal(':while 1 | endwhile', term_getline(buf, 6))})
10195
exe 'silent !kill -s INT ' .. pid_vim
96+
sleep 50m
10297
call term_sendkeys(buf, ":call setline(1, 'INTERRUPTED')\n")
10398
call WaitForAssert({-> assert_equal('INTERRUPTED', term_getline(buf, 1))})
10499

@@ -112,13 +107,6 @@ func Test_signal_TSTP()
112107
throw 'Skipped: TSTP signal not supported'
113108
endif
114109

115-
" Skip the test when running with valgrind as signal TSTP is not received
116-
" somehow by Vim when running with valgrind.
117-
let cmd = GetVimCommand()
118-
if cmd =~ 'valgrind'
119-
throw 'Skipped: cannot test signal TSTP with valgrind'
120-
endif
121-
122110
" If test fails once, it can leave temporary files and trying to rerun
123111
" the test would then fail again if they are not deleted first.
124112
call delete('.Xsig_TERM.swp')
@@ -142,9 +130,10 @@ func Test_signal_TSTP()
142130
exe 'silent !kill -s TSTP ' .. pid_vim
143131
call WaitForAssert({-> assert_true(filereadable('.Xsig_TERM.swp'))})
144132

145-
" We resume after the suspend
133+
" We resume after the suspend. Sleep a bit for the signal to take effect,
134+
" also when running under valgrind.
146135
exe 'silent !kill -s CONT ' .. pid_vim
147-
exe 'silent !sleep 0.006'
136+
sleep 100m
148137

149138
call StopVimInTerminal(buf)
150139

src/version.c

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

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
5158,
738740
/**/
739741
5157,
740742
/**/

0 commit comments

Comments
 (0)