test: unreliable "job exit event on jobstart(…,{term=true})"

Problem:
Test often fails in cirrus (bsd) ci:

    FAILED   test/functional/terminal/channel_spec.lua @ 149: no crash when TermOpen autocommand processes job exit event when using jobstart(…,{term=true})
    test/functional/terminal/channel_spec.lua:158: Row 1 did not match.
    Expected:
      |*^ready $ foobar                                              |
      |*                                                            |
      |*[Process exited 0]                                          |
      |                                                            |
    Actual:
      |*^ready $                                                     |
      |*[Process exited 0]                                          |
      |*                                                            |
      |                                                            |

Solution:
Use one printf call instead of multiple.
This commit is contained in:
Justin M. Keyes
2025-12-01 22:58:12 -05:00
parent 310d01d8fa
commit c8f2b10a40
2 changed files with 4 additions and 3 deletions

View File

@@ -66,9 +66,10 @@ int main(int argc, char **argv)
}
}
} else if (strcmp(argv[1], "EXE") == 0) {
fprintf(stderr, "ready $ ");
if (argc >= 3) {
fprintf(stderr, "%s\n", argv[2]);
fprintf(stderr, "ready $ %s\n", argv[2]);
} else {
fprintf(stderr, "ready $ ");
}
} else if (strcmp(argv[1], "REP") == 0) {
if (argc != 4) {

View File

@@ -146,7 +146,7 @@ describe('no crash when TermOpen autocommand', function()
screen = Screen.new(60, 4)
end)
it('processes job exit event when using jobstart(…,{term=true})', function()
it('processes job exit event on jobstart(…,{term=true})', function()
command([[autocmd TermOpen * call input('')]])
async_meths.nvim_command('terminal foobar')
screen:expect([[