Skip to content

Neotest watch does not work in a large Go repo #93

@asfaltboy

Description

@asfaltboy

I've got a large repo with hundreds of packages, and thousands of files, and test watcher seems to not run any test on change.

Debug logs shows a lot of continuous messages such as:

DEBUG | 2024-05-20T14:55:11Z+0100 | ...vim/lazy/neotest/lua/neotest/consumers/watch/watcher.lua:79 | Found 1 linked files for
file1.go
DEBUG | 2024-05-20T14:55:11Z+0100 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:140 | Waiting for result 910
INFO | 2024-05-20T14:55:11Z+0100 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:153 | CHILD | Received remote call 910 <function 1>
DEBUG | 2024-05-20T14:55:11Z+0100 | ...vim/lazy/neotest/lua/neotest/consumers/watch/watcher.lua:19 | CHILD | Parsing symbols for file2.go
DEBUG | 2024-05-20T14:55:11Z+0100 | ...al/share/nvim/lazy/neotest/lua/neotest/lib/file/init.lua:22 | CHILD | Reading file: file2.go
DEBUG | 2024-05-20T14:55:11Z+0100 | ...l/share/nvim/lazy/neotest/lua/neotest/lib/subprocess.lua:91 | Result registed for callback 910
DEBUG | 2024-05-20T14:55:11Z+0100 | ...vim/lazy/neotest/lua/neotest/consumers/watch/watcher.lua:50 | Getting symbol definitions for file2.go

Where the file names alternate between different files, and seem to be repeating. (note that 'registed' message is mis-typed in the actual code)

When saving a change in the test module, I see this emitted in the debug log:

DEBUG | 2024-05-20T15:03:18Z+0100 | ...ocal/share/nvim/lazy/neotest/lua/neotest/client/init.lua:305 | Found { {
    id = "test_file.go",
    name = "test_file.go",
    path = "test_file.go",
    range = { 0, 0, 75, 0 },
    type = "file"
  }, { {
      id = "test_file.go::TestRepository_List",
      name = "TestRepository_List",
      path = "test_file.go",
      range = { 17, 0, 41, 1 },
      type = "test"
    } }, { {
      id = "test_file.go::TestRepository_ListWithFilter",
      name = "TestRepository_ListWithFilter",
      path = "test_file.go",
      range = { 43, 0, 74, 1 },
      type = "test"
    } } }
DEBUG | 2024-05-20T15:03:18Z+0100 | ...hare/nvim/lazy/neotest/lua/neotest/client/state/init.lua:54 | New positions at ID test_file.go
INFO | 2024-05-20T15:03:18Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting discover_positions event
DEBUG | 2024-05-20T15:03:18Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener diagnostic for event discover_positions
DEBUG | 2024-05-20T15:03:18Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener status for event discover_positions
DEBUG | 2024-05-20T15:03:18Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener state for event discover_positions
DEBUG | 2024-05-20T15:03:18Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event discover_positions
INFO | 2024-05-20T15:03:19Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:48 | Emitting test_focused event
DEBUG | 2024-05-20T15:03:19Z+0100 | ...are/nvim/lazy/neotest/lua/neotest/client/events/init.lua:50 | Calling listener summary for event test_focused

Note: I shortened and obfuscated file/path to protect the identity of the code owner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions