Closed rouge8 closed 2 years ago
I was able to reproduce it in the Django repo: https://recordit.co/xMyHPQATnE My guess is it's something to do with the number of tests or files in the project...
It looks like adapter.discover_positions()
is called on ~every test file in the repo, I wonder if that's related...
Likely the same issue I had with large repos in #13. Try setting discovery.enabled = false
. You lose the ability to see and run all tests, but it should fix the perf issue.
I've done a quick check myself and didn't see any slowdown with running other than a lot renders when the summary window was open (which should be fixed now). Is it just fzf that slows down or the entire Neovim instance?
It looks like adapter.discover_positions() is called on ~every test file in the repo, I wonder if that's related...
Can you open the summary window instead of running tests to see? This will isolate discovery from running tests.
I also had pyright absolutely tank my instance while processing, can you double check LSP isn't slowing things down as well?
Is it just fzf that slows down or the entire Neovim instance?
The entire Neovim instance is slow while the test runs, but the FZF window is still slow after it finishes.
Can you open the summary window instead of running tests to see? This will isolate discovery from running tests.
Opening FZF after the test summary is a little slow, maybe 1-2 seconds, but not as slow as after the tests.
I also had pyright absolutely tank my instance while processing, can you double check LSP isn't slowing things down as well?
After stopping the LSP with :LspStop
and running Neotest on the nearest test, FZF takes 4-5 seconds to open.
Likely the same issue I had with large repos in #13. Try setting
discovery.enabled = false
. You lose the ability to see and run all tests, but it should fix the perf issue.
This seems to fix the issue.
OK I'll close this then as it seems to be as it's the same underlying issue :+1:
May have spoken too soon on this being the same issue. I noticed a slow down due to the diagnostic consumer when tests completed. I've fixed it in the latest commit if you want to see if that helps
Hmm nope, the FZF terminal still takes 10-15 seconds to open after running a test once I re-enable discovery.
I was thinking you were using the neotest-python adapter with django but then remembered django has it's own test runner. Are you using neotest-vim-test instead?
I was using pytest to run the Django tests. I also use pytest in the work project.
Can you share how to do that? I've no experience with Django and a quick skim of the docs aren't very helpful :sweat_smile:
Oh, I misremembered! It didn't actually discover any tests, but that was still enough to reproduce the issue as you can see in the recording I posted above.
OK that makes more sense thanks :+1:
I'm not sure if this is a neotest or neotest-python issue, so I decided to open it here. I'm using fzf and fzf.vim with a
GitFiles
command:After running
neotest.run.run()
orneotest.run.run(vim.fn.expand("%"))
, the fzf floating terminal window takes 10-15 seconds to populate after the window appears. Navigating the window also lags by seconds once it opens, but if you wait the lag disappears. I can reproduce this on any Python file in my work repository, but not a Rust file in the same repository.