neotest
neotest copied to clipboard
[BUG] CMD Neotest Summary freezes Neovim
NeoVim Version NVIM v0.10.0 Build type: Release LuaJIT 2.1.1716656478 Run "nvim -V1 -v" for more info
Describe the bug In 90% of my cases, the execution of the Neotest Summary command freezes my Neovim. There is no option to quit neovim anymore.
To Reproduce Sorry I can not provide a minimal example, because sometimes it works just fine ...
My neotest-config:
return {
'nvim-neotest/neotest',
dependencies = {
'nvim-neotest/nvim-nio',
'nvim-lua/plenary.nvim',
'antoinemadec/FixCursorHold.nvim',
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('neotest').setup {
adapters = {
require 'neotest-python' {
dap = { justMyCode = false },
args = { '-vv', '-s' },
runner = 'pytest',
},
},
}
end,
keys = {
{ '<leader>ta', "<cmd>lua require('neotest').run.run(vim.fn.getcwd())<cr>", desc = '[T]est [a]ll' },
{ '<leader>tf', "<cmd>lua require('neotest').run.run(vim.fn.expand('%'))<cr>", desc = '[T]est current [f]ile' },
{ '<leader>tn', "<cmd>lua require('neotest').run.run()<cr>", desc = '[T]est nearest test' },
{ '<leader>tx', "<cmd>lua require('neotest').run.stop()<cr>", desc = 'Stop test' },
{ '<leader>tl', "<cmd>lua require('neotest').run.run_last()<cr>", desc = 'Run last test' },
{ '<leader>tdn', "<cmd>lua require('neotest').run.run({strategy = 'dap'})<cr>", desc = '[T]est debug nearest test' },
{ '<leader>ts', "<cmd>lua require('neotest').summary.toggle({ enter = true })<cr>", desc = 'toggle summary' },
{ '<leader>to', "<cmd>lua require('neotest').output_panel.toggle()<cr>", desc = 'toggle output panel' },
},
}
Steps to reproduce the behavior:
lua require('neotest').summary.toggle({ enter = true })
Logs Log of a failed run. It seems that somehow the connection to the child process could not be established.
INFO | 2024-07-21T14:52:35Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process
INFO | 2024-07-21T14:52:35Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:64986
INFO | 2024-07-21T14:52:35Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: /opt/homebrew/Cellar/neovim/0.10.0/bin/nvim --embed --headless -n
here is a log file of a successful run:
INFO | 2024-07-21T14:50:32Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:33 | Starting child process
INFO | 2024-07-21T14:50:32Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:36 | Parent address: localhost:64927
INFO | 2024-07-21T14:50:32Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:42 | Starting child process with command: /opt/homebrew/Cellar/neovim/0.10.0/bin/nvim --embed --headless -n
ERROR | 2024-07-21T14:50:33Z+0200 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:57 | Child process is waiting for input at startup. Aborting.
INFO | 2024-07-21T14:50:33Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:378 | Initialising client
INFO | 2024-07-21T14:50:33Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting starting event
DEBUG | 2024-07-21T14:50:33Z+0200 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event starting
INFO | 2024-07-21T14:50:33Z+0200 | ...al/share/nvim/lazy/neotest/lua/neotest/adapters/init.lua:18 | Found 1 adapters for directory /Users/xxx/Code/xxx/main
DEBUG | 2024-07-21T14:50:33Z+0200 | ...al/share/nvim/lazy/neotest/lua/neotest/adapters/init.lua:19 | Adapters: { {
adapter = {
build_spec = <function 1>,
discover_positions = <function 2>,
filter_dir = <function 3>,
is_test_file = <function 4>,
name = "neotest-python",
results = <function 5>,
root = <function 6>,
<metatable> = {
__call = <function 7>
}
},
root = "/Users/xxx/xxx/main"
} }
INFO | 2024-07-21T14:50:33Z+0200 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:279 | Searching /Users/xxx/Code/xxx/main for test files
...
Additional context neotest-python 0.07ms start dir /Users/julianfrenzel/.local/share/nvim/lazy/neotest-python url https://github.com/nvim-neotest/neotest-python branch master commit 2e83d2b readme README.md
neotest