vim-maktaba icon indicating copy to clipboard operation
vim-maktaba copied to clipboard

Remove need for delays when testing neovim jobcontrol

Open okkays opened this issue 5 years ago • 2 comments

In #234, (0.2s) delay controls were added to CallAsync tests in system-job.vroom. Figure out why that extra delay is needed, fix the cause, and remove the delays.

Some notes:

  • The commands don't seem to need the extra delay in practice (plugins depending on the jobcontrol implementation use it and work fine)
  • Per debugging detailed in this comment, with no delay, it appears that maktaba#syscall#neovim#HandleJobExit is receiving the stdout of the call, but shell.vroomfaker isn't reporting that it received it.

okkays avatar Aug 06 '20 16:08 okkays

I did a little more digging on this. Still no real answers, but a few observations:

  • Might involve buffered I/O since IIRC the output files written by vroom.shellfaker are the way it "receives" system calls. I tried adding some flush() calls into the shellfaker but didn't see any improvement.
  • Might help to compare strace output with/without the extra delay (strace -o strace.out vroom --neovim vroom/system-job.vroom). I saw a few differences but got a little stuck making sense of them.

I guess generally this shouldn't be a concern outside of maktaba tests since tests should override and disable async execution anyway (except for tests like this specifically trying to cover async execution behavior). Just frustrating to not understand why the workaround delays are needed.

dbarnett avatar Nov 01 '20 09:11 dbarnett

FYI I've been running into other timing issues in neovim mode, this time just executing a foreground shell command with :!, when running in Travis CI anyway (see https://github.com/google/vroom/issues/2).

dbarnett avatar Jan 31 '21 15:01 dbarnett