google/vim-maktaba

Remove need for delays when testing neovim jobcontrol

okkays opened this issue · 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.

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.

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 google/vroom#2).