nvim-neotest / nvim-neotest/neotest-python

Test error when switching buffers by using tags (Ctrl+]) or gd (go to definition) in neovim.

Open
#88 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
192
Forks
60
PR merge metrics
No merged PRs in 30d

Description

I'm not sure where to begin and I'm not sure if this is a neotest issue, to be honest.

But every time I open a new window, come back to the previous buffer and perform a new test I get an error:

https://github.com/user-attachments/assets/8475e78f-6a76-42e1-bc54-14e907bb6f5e

The output:

Error executing vim.schedule lua callback: ...istina/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua💯 Async task failed without callback
: The coroutine failed with this message:
...local/share/nvim/lazy/neotest/lua/neotest/lib/window.lua:69: Failed to rename buffer
stack traceback:
[C]: in function 'nvim_buf_set_name'
...local/share/nvim/lazy/neotest/lua/neotest/lib/window.lua:69: in function 'buffer'
...lazy/neotest/lua/neotest/consumers/output_panel/init.lua:29: in function 'listener'
...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:51: in function <...are/nvim/lazy/neotest/lua/neotest/client/events/init.l
ua:47>
stack traceback:
[C]: in function 'error'
...istina/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua💯 in function 'close_task'
...istina/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:122: in function 'cb'
...istina/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:188: in function <...istina/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.
lua:187>

lsp.log:

[START][2024-11-13 13:27:19] LSP logging initiated
[ERROR][2024-11-13 13:27:19] .../vim/lsp/rpc.lua:770 "rpc" "/usr/bin/pylsp" "stderr" "2024-11-13 13:27:19,893 -03 - WARNING - pylsp_jsonrpc.endpoint - Received cancel notification for unknown message id 2\n"

I can only perform tests again after close neovim. Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the buffer-switching and test-run sequence, then inspect neotest/lib/window.lua at line 69 and output_panel/init.lua at line 29 around the nvim_buf_set_name failure. Compare the buffer state before and after using Ctrl+] or gd; done means tests can be run again after switching buffers without restarting Neovim.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, python
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.