TestItems produces error in VSCode

Hello,

I am trying to use TestItems.jl with VSCode, but I have encountered the following error:

An error occurred attempting to run tests: Error: Pending response rejected since connection got disposed

The output in the Test Results tab says The test run did not record any output.

I was able to run the test successfully from package mode:

     Testing Running tests...
Test Summary: | Pass  Total  Time
Package       |    1      1  0.2s
     Testing TestItemPackage tests passed

Any help would be appreciated.

Setup

Version Info

versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 Ă— Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, haswell)
Threads: 4 default, 0 interactive, 2 GC (on 8 virtual cores)
Environment:
  JULIA_CMDSTAN_HOME = /home/dfish/cmdstan
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = code
(test) pkg> st
Status `~/.julia/dev/TestItemPackage/test/Project.toml`
  [f8b46487] TestItemRunner v1.0.5
  [1c621080] TestItems v1.0.0
  [8dfed614] Test
Version: 1.92.2
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Linux x64 5.4.0-193-generic
1 Like

Hm, I just tried your package on my machine and it all works to run the test items in VS Code.

Could you copy/paste from the Output logs for the Julia Language Server and Julia Testserver?

Thank you for your reply. I am having trouble finding the logs for the Language and Test server. I couldn’t find anything in the VSCode search bar, or the online docs. Could you please point me in the right direction?

You can find them here:

Thanks!

Strangely, there were no logs for the Testsever. The logs for the language server were too long to post in full. I used my judgment on what might be useful by selecting the last portion where keyword testitems was found. If that is not diagonostic, I can find another way to provide the entire log.

Julia Language Server Logs

[1] is_path_project_file(path::Nothing)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/fileio.jl:6
[2] (::JuliaWorkspaces.var"#5#6")(file::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ./strings/string.jl:0
[3] iterate(f::Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, state::Int64)
@ Base.Iterators ./iterators.jl:518
[4] iterate
@ ./generator.jl:44 [inlined]
[5] grow_to!(dest::Vector{JuliaWorkspaces.URIs2.URI}, itr::Base.Generator{Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, typeof(identity)}, st::Int64)
@ Base ./array.jl:938
[6] grow_to!
@ ./array.jl:911 [inlined]
[7] collect(itr::Base.Generator{Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, typeof(identity)})
@ Base ./array.jl:831
[8] %%__user_derived_project_files
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:4 [inlined]
[9] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_files), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[10] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_files), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[11] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[12] derived_project_files
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[13] var"%%__user_derived_potential_project_folders"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:8
[14] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_potential_project_folders), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[15] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_potential_project_folders), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[16] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[17] derived_potential_project_folders
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[18] var"%%__user_derived_project_folders"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:113
[19] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_folders), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[20] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_folders), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[21] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[22] derived_project_folders
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[23] var"%%__user_derived_testenv"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_testitems.jl:106
[24] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_testenv), Tuple{JuliaWorkspaces.URIs2.URI}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[25] memoized_lookup(rt::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_testenv), Tuple{JuliaWorkspaces.URIs2.URI}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[26] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[27] derived_testenv(rt::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641
[28] get_test_env(jw::JuliaWorkspaces.JuliaWorkspace, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/public.jl:153
[29] julia_get_test_env_request(params::LanguageServer.GetTestEnvRequestParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/requests/testing.jl:2
[30] (::LanguageServer.var"#108#109"{typeof(LanguageServer.julia_get_test_env_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.GetTestEnvRequestParams)
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:283
[31] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JSONRPC/src/typed.jl:67
[32] run(server::LanguageServerInstance; timings::Vector{Any})
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:416
[33] run(server::LanguageServerInstance)
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:293
[34] top-level scope
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/languageserver/main.jl:189
[35] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[36] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:318
[37] _start()
@ Base ./client.jl:552
[Info - 5:55:36 PM] Connection to server got closed. Server will restart.
true

Part 2

Error: Some Julia code in the VS Code extension crashed
â”” @ Main ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/error_handler.jl:15
ERROR: SalsaWrappedException: Error encountered while executing Salsa derived function:
MethodError: no method matching lowercase(::Nothing)

Closest candidates are:
lowercase(!Matched::AbstractString)
@ Base strings/unicode.jl:623
lowercase(!Matched::T) where T<:AbstractChar
@ Base strings/unicode.jl:290

------ Salsa Trace -----------------
[1] @derived derived_testenv(::Runtime, JuliaWorkspaces.URIs2.URI(“file”, “”, “/home/dfish/.julia/dev/TestItemPackage/test/test_file.jl”, nothing, nothing)::JuliaWorkspaces.URIs2.URI)
[2] @derived derived_project_folders(::Runtime)
[3] @derived derived_potential_project_folders(::Runtime)
[4] @derived derived_project_files(::Runtime)

Stacktrace:
[1] is_path_project_file(path::Nothing)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/fileio.jl:6
[2] (::JuliaWorkspaces.var"#5#6")(file::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ./strings/string.jl:0
[3] iterate(f::Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, state::Int64)
@ Base.Iterators ./iterators.jl:518
[4] iterate
@ ./generator.jl:44 [inlined]
[5] grow_to!(dest::Vector{JuliaWorkspaces.URIs2.URI}, itr::Base.Generator{Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, typeof(identity)}, st::Int64)
@ Base ./array.jl:938
[6] grow_to!
@ ./array.jl:911 [inlined]
[7] collect(itr::Base.Generator{Base.Iterators.Filter{JuliaWorkspaces.var"#5#6", Set{JuliaWorkspaces.URIs2.URI}}, typeof(identity)})
@ Base ./array.jl:831
[8] %%__user_derived_project_files
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:4 [inlined]
[9] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_files), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[10] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_files), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[11] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[12] derived_project_files
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[13] var"%%__user_derived_potential_project_folders"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:8
[14] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_potential_project_folders), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[15] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_potential_project_folders), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[16] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[17] derived_potential_project_folders
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[18] var"%%__user_derived_project_folders"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage})
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_projects.jl:113
[19] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_folders), Tuple{}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[20] memoized_lookup(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_project_folders), Tuple{}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[21] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[22] derived_project_folders
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641 [inlined]
[23] var"%%__user_derived_testenv"(rt::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/layer_testitems.jl:106
[24] _memoized_lookup_internal(runtime::Salsa._TracingRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_testenv), Tuple{JuliaWorkspaces.URIs2.URI}})
@ Salsa._DefaultSalsaStorage ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/default_storage.jl:257
[25] memoized_lookup(rt::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, dependency_key::Salsa.DerivedKey{typeof(JuliaWorkspaces.derived_testenv), Tuple{JuliaWorkspaces.URIs2.URI}})
@ Salsa ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:694
[26] memoized_lookup_unwrapped
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:721 [inlined]
[27] derived_testenv(rt::Salsa._TopLevelRuntime{Salsa.EmptyContext, Salsa._DefaultSalsaStorage.DefaultStorage}, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/Salsa/src/Salsa.jl:641
[28] get_test_env(jw::JuliaWorkspaces.JuliaWorkspace, uri::JuliaWorkspaces.URIs2.URI)
@ JuliaWorkspaces ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JuliaWorkspaces/src/public.jl:153
[29] julia_get_test_env_request(params::LanguageServer.GetTestEnvRequestParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/requests/testing.jl:2
[30] (::LanguageServer.var"#108#109"{typeof(LanguageServer.julia_get_test_env_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.GetTestEnvRequestParams)
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:283
[31] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/JSONRPC/src/typed.jl:67
[32] run(server::LanguageServerInstance; timings::Vector{Any})
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:416
[33] run(server::LanguageServerInstance)
@ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:293
[34] top-level scope
@ ~/.vscode/extensions/julialang.language-julia-1.109.2/scripts/languageserver/main.jl:189
[35] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[36] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:318
[37] _start()
@ Base ./client.jl:552
[Info - 7:27:22 PM] Connection to server got closed. Server will restart.
true
[Error - 7:27:23 PM] Server process exited with code 1.

Can you update the extension? I think I fixed that bug in one of the latest releases. If it still happens in the released version, maybe also try the prerelease version?

I tried v1.120.2 and v1.121.1 (pre-release), but recieved the same error for each. I also restarted VSCode in each case to make sure I was using the latest version.

I’ve just pushed a new build out to the insider channel that has some more diagnostics to get to the bottom of this.

Could you switch over to the insider channel, and then just run the extension? I think in theory if it crashes it should then automatically send a crash report, or you could copy/paste the log here again. Thanks!