LuaLS / LuaLS/lua-language-server

Test failure: attempt to yield from outside a coroutine

Open
#2,896 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

How are you using the lua-language-server?

Other

Which OS are you using?

Linux

What is the issue affecting?

Other

Expected Behaviour

The test suite should pass consistently.

Actual Behaviour

One time when running the tests, I saw this failure. However, I haven't seen it since.

bin/lua-language-server: attempt to yield from outside a coroutine
stack traceback:
	[C]: in function 'coroutine.yield'
	script/await.lua:152: in function 'await.wait'
	script/workspace/workspace.lua:529: in function 'workspace.workspace.awaitReady'
	test/full/self.lua:35: in main chunk
	[C]: in upvalue 'originRequire'
	test.lua:42: in function 'require'
	test/full/init.lua:28: in main chunk
	[C]: in upvalue 'originRequire'
	test.lua:42: in function 'require'
	test.lua:48: in upvalue 'test'
	test.lua:109: in local 'main'
	test.lua:115: in main chunk
	(bootstrap.lua):85: in main chunk
	[C]: in ?

The test failed in Alpine's build system CI and the full output is here: https://gitlab.alpinelinux.org/xordspar0/aports/-/jobs/1554206

Reproduction steps
  1. git clone --recursive https://github.com/LuaLS/lua-language-server.git
  2. cd lua-language-server
  3. ninja -C 3rd/luamake -f compile/ninja/linux.ninja
  4. 3rd/luamake/luamake all
  5. 3rd/luamake/luamake unit-test
  6. Rarely see the above failure.
Additional Notes

lua-language-server version: 3.11.1

Log File

No response

Contributor guide

Open the contributing guide

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 running the listed build and unit-test commands, then inspect script/await.lua, workspace/workspace.lua, and test/full/self.lua around the reported coroutine.yield stack. Use the Alpine CI log and repeated test runs to investigate the intermittent failure. Done means the unit-test suite passes consistently without yielding outside a coroutine.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.