[vim/vim] Test_matchfuzzy_initialized fails if vim runs too quickly (Issue #18821)

3 views
Skip to first unread message

Corey Hickey

unread,
Nov 28, 2025, 1:53:04 AM (yesterday) Nov 28
to vim/vim, Subscribed
bugfood created an issue (vim/vim#18821)

Steps to reproduce

This is a race condition.

  1. Have a fast CPU and have the vim source code on fast storage, ideally within the OS page cache. For reference, I am seeing this behavior on a Ryzen 9800X3D at standard clock speeds. On a slower CPU, the problem may likely be induced by waiting longer:
diff --git a/src/testdir/test_matchfuzzy.vim b/src/testdir/test_matchfuzzy.vim
index 0ee1b7ba6..0342357b8 100644
--- a/src/testdir/test_matchfuzzy.vim
+++ b/src/testdir/test_matchfuzzy.vim
@@ -300,7 +300,9 @@ func Test_matchfuzzy_initialized()
 
   let buf = RunVimInTerminal('-u NONE -X -Z', {})
   call term_sendkeys(buf, ":source XTest_matchfuzzy\n")
-  call TermWait(buf, 2000)
+  " TermWait waits longer on retries, leading to test timeouts with higher
+  " specified values.
+  call term_wait(buf, 20000)
 
   let job = term_getjob(buf)
   if job_status(job) == "run"
  1. Run make test or run Test_matchfuzzy_initialized directly via:
cd src/testdir && vim -u NONE -S runtest.vim test_matchfuzzy.vim Test_matchfuzzy_initialized ; cat test.log

Expected behaviour

The test should pass.

Version of Vim

git 33fbfe0

Environment

OS: Debian Sid
Terminal: rxvt-unicode-256color
$TERM: rxvt-unicode-256color
Shell: bash

Logs and stack traces

From within `src/testdir`:

$ rm test.log ; vim -u NONE -S runtest.vim test_matchfuzzy.vim Test_matchfuzzy_initialized ; cat test.log
rm: cannot remove 'test.log': No such file or directory
2 files to edit


From test_matchfuzzy.vim:
Found errors in Test_matchfuzzy_initialized():
Run 1, 19:27:55 - 19:28:02 in  7.066277 seconds:
command line..script /usr/local/src/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_matchfuzzy_initialized[22]..StopVimInTerminal[17]..WaitForAssert[2]..<SNR>3_WaitForCommon[11]..<lambda>2 line 1: Expected 'finished' but got 'running'
Run 2, 19:28:04 - 19:28:17 in 13.279118 seconds:
command line..script /usr/local/src/vim/src/testdir/runtest.vim[677]..function RunTheTest[63]..Test_matchfuzzy_initialized[22]..StopVimInTerminal[17]..WaitForAssert[2]..<SNR>3_WaitForCommon[11]..<lambda>4 line 1: Expected 'finished' but got 'running'
Run 3, 19:28:21 - 19:28:47 in 25.650709 seconds:
command line..script /usr/local/src/vim/src/testdir/runtest.vim[677]..function RunTheTest[63]..Test_matchfuzzy_initialized[22]..StopVimInTerminal[17]..WaitForAssert[2]..<SNR>3_WaitForCommon[11]..<lambda>6 line 1: Expected 'finished' but got 'running'
Run 4, 19:28:53 - 19:29:18 in 25.638724 seconds:
command line..script /usr/local/src/vim/src/testdir/runtest.vim[677]..function RunTheTest[63]..Test_matchfuzzy_initialized[22]..StopVimInTerminal[17]..WaitForAssert[2]..<SNR>3_WaitForCommon[11]..<lambda>8 line 1: Expected 'finished' but got 'running'
Run 5, 19:29:26 - 19:29:52 in 25.651644 seconds:
command line..script /usr/local/src/vim/src/testdir/runtest.vim[677]..function RunTheTest[63]..Test_matchfuzzy_initialized[22]..StopVimInTerminal[17]..WaitForAssert[2]..<SNR>3_WaitForCommon[11]..<lambda>10 line 1: Expected 'finished' but got 'running'
Flaky test failed too often, giving up


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18821@github.com>

Reply all
Reply to author
Forward
0 new messages