]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0438: tests: test_plugin_termdebug is flaky v9.2.0438
authorJesse Rosenstock <jmr@google.com>
Mon, 4 May 2026 19:22:25 +0000 (19:22 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 4 May 2026 19:22:25 +0000 (19:22 +0000)
Problem:  Test_termdebug_tbreak(), Test_termdebug_basic(), and
          Test_termdebug_toggle_break() use synchronous assert_equal()
          to check breakpoint signs immediately after sending commands
          to gdb.  On slow CI (ASAN, ARM64, macOS) gdb may not have
          processed the response yet, causing the sign to be missing.
Solution: Wrap the three assertions in WaitForAssert() to poll until
          the signs are placed, matching the pattern already used by
          the other assertions in the same tests (Jesse Rosenstock).

closes: #20133

Co-authored-by: Gemini
Signed-off-by: Jesse Rosenstock <jmr@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_plugin_termdebug.vim
src/version.c

index f6518064835d3f917223e97b385e433f8649154d..4e892522282b59e5ebbe3fdd9fc208831b0f3859 100644 (file)
@@ -162,10 +162,10 @@ func Test_termdebug_basic()
   Break 9
   call term_wait(gdb_buf)
   redraw!
-  call assert_equal([
+  call WaitForAssert({-> assert_equal([
         \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
         \  'priority': 110, 'group': 'TermDebug'}],
-        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)
+        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
   Run
   call term_wait(gdb_buf, 400)
   redraw!
@@ -324,12 +324,12 @@ func Test_termdebug_tbreak()
   call term_wait(gdb_buf)
   redraw!
   " both temporary and normal breakpoint signs were displayed...
-  call assert_equal([
+  call WaitForAssert({-> assert_equal([
         \ {'lnum': temp_bp_line, 'id': 1014, 'name': 'debugBreakpoint1.0',
         \  'priority': 110, 'group': 'TermDebug'},
         \ {'lnum': bp_line, 'id': 2014, 'name': 'debugBreakpoint2.0',
         \  'priority': 110, 'group': 'TermDebug'}],
-        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)
+        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
 
   Run
   call term_wait(gdb_buf, 400)
@@ -717,10 +717,10 @@ func Test_termdebug_toggle_break()
 
   call term_wait(gdb_buf)
   redraw!
-  call assert_equal([
+  call WaitForAssert({-> assert_equal([
         \ {'lnum': bp_line, 'id': 1014, 'name': 'debugBreakpoint1.0',
         \  'priority': 110, 'group': 'TermDebug'}],
-        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)
+        \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
 
   RunOrContinue
   call term_wait(gdb_buf, 400)
index 597842bf9c6a605a127fa5ee766854cd6a56aed6..59084a36250db834e89c2a0cbf7d825be00557cd 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    438,
 /**/
     437,
 /**/