Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Getting error "Future already set" and output_panel is empty for python tests #402

Closed
DanilaMihailov opened this issue May 1, 2024 · 7 comments
Assignees

Comments

@DanilaMihailov
Copy link

NeoVim Version
NVIM v0.10.0-dev-3050+gcb24a3907
Build type: Release
LuaJIT 2.1.1713484068

and

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1713517273

Describe the bug
Getting error

.../zen/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:133: Future already set
stack traceback:
	[C]: in function 'error'
	.../zen/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:133: in function 'set_error'
	...rs/zen/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:93: in function 'close_task'
	...rs/zen/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:111: in function 'cb'
	...rs/zen/.local/share/nvim/lazy/nvim-nio/lua/nio/tasks.lua:185: in function 'waiter'
	.../zen/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:116: in function 'wake'
	.../zen/.local/share/nvim/lazy/nvim-nio/lua/nio/control.lua:129: in function 'set'
	...eotest/lua/neotest/client/strategies/integrated/init.lua:48: in function <...eotest/lua/neotest/client/strategies/integrated/init.lua:45>

and ouput of :Neotest output-panel is empty

To Reproduce

vim.opt.runtimepath:remove(vim.fn.expand '~/.config/nvim')
vim.opt.packpath:remove(vim.fn.expand '~/.local/share/nvim/site')

local lazypath = '/tmp/lazy/lazy.nvim'

if not vim.loop.fs_stat(lazypath) then
  vim.fn.system {
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    '--branch=stable', -- latest stable release
    lazypath,
  }
end

vim.opt.rtp:prepend(lazypath)

require('lazy').setup {
  'nvim-neotest/neotest',
  dependencies = {
    'nvim-neotest/nvim-nio',
    'nvim-lua/plenary.nvim',
    'antoinemadec/FixCursorHold.nvim',
    'nvim-treesitter/nvim-treesitter',
    'nvim-neotest/neotest-python',
  },
  config = function()
    -- Install any required parsers
    require('nvim-treesitter.configs').setup {
      ensure_installed = { 'python' },
    }
    require('neotest').setup {
      -- Add adapters to the list
      adapters = {


        require 'neotest-python',
      },
    }
  end,
}

Steps to reproduce the behavior:

  1. :Neotest summary
  2. Navigate to summary view
  3. Press "r" on "tests"
  4. Tests run fine, diagnostics works, but getting exception
  5. :Neotest output-panel is empty

I am not sure if this is related to particular tests I am running, but I can try to create small example if nedded.

Expected behavior
Expected :Neotest output-panel to contain logs from pytest. Tried it with tests in this repo with neotest-plenary and it works as expected

Logs
logs.txt

@zargham-leanix
Copy link

same issue for me, using neotest-jest

@UN-9BOT
Copy link

UN-9BOT commented May 2, 2024

same issue for me
neotest-python

@UN-9BOT
Copy link

UN-9BOT commented May 2, 2024

I downgraded the version for nio { "nvim-neotest/nvim-nio", version = "1.9.0" }, and it worked

@afrischk
Copy link

afrischk commented May 2, 2024

Did not work for me.

    use { "nvim-neotest/nvim-nio", version="1.9.0"}
    use { "nvim-neotest/neotest"}
    use { "nvim-neotest/neotest-python" }

@UN-9BOT
Copy link

UN-9BOT commented May 2, 2024

Did not work for me.

    use { "nvim-neotest/nvim-nio", version="1.9.0"}
    use { "nvim-neotest/neotest"}
    use { "nvim-neotest/neotest-python" }

did you update the dependencies through your plugin manager?
I use lazy. Perhaps you have version control in a different way?

@DanilaMihailov
Copy link
Author

worked for me with this config

  {
    'nvim-neotest/neotest',
    dependencies = {
      { 'nvim-neotest/nvim-nio', version = '1.9.0' },
      'nvim-neotest/neotest-python',
    },

and I synced dependecies with Lazy and restarted neovim

@rcarriga
Copy link
Collaborator

rcarriga commented May 2, 2024

Closing as duplicate of the issue is being discussed in nvim-neotest/nvim-nio#15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants