nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.12k stars 105 forks source link

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

Closed DanilaMihailov closed 2 months ago

DanilaMihailov commented 2 months ago

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 commented 2 months ago

same issue for me, using neotest-jest

UN-9BOT commented 2 months ago

same issue for me neotest-python

UN-9BOT commented 2 months ago

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

afrischk commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

Closing as ~duplicate of~ the issue is being discussed in https://github.com/nvim-neotest/nvim-nio/issues/15