This PR fixes several causes of test flakiness and re-enables the tests that were disabled in #10665, #10669 and #10673. Specifically, it fixes: - A race condition in the file worker that caused it to report an incomplete snapshot prefix in the inlay hint request (confirmed to be the cause of #10665) - A bug in the test runner where it didn't correctly account for non-deterministic message ordering inducing different RPC pointer numbering (confirmed to be the cause of #10673) - A race condition in the watchdog that would sometimes cause the module hierarchy to be empty (likely the cause of #10669, but not confirmed as this issue only reproduced again once in tens of thousands of test runs on various machines, including CI) - An unrelated bug in the module hierarchy implementation that would cause it to report an empty module hierarchy when the file was changed It also replaces some calls to `Task.get` in the language server with `IO.wait` to protect the code against unfortunate compiler re-ordering.
28 lines
671 B
Text
28 lines
671 B
Text
import Lean.Server.Test.Refs
|
||
--^ waitForILeans
|
||
|
||
inductive Unit' where
|
||
| mk
|
||
|
||
inductive Sum' (α β) where
|
||
| left (a : α)
|
||
| right (b : β)
|
||
|
||
def foo : Unit' := .mk
|
||
def bar := foo
|
||
def foobar (s : Sum' α β) : Unit' :=
|
||
match s with
|
||
| .left _ => foo
|
||
| .right _ => bar
|
||
def barfoo (s : Sum' α β) := foobar s
|
||
--^ outgoingCallHierarchy
|
||
|
||
def test12 (_ : Lean.Server.Test.Refs.Test6) : Unit' := .mk
|
||
|
||
def test11 (s : Sum' α β) : Unit' :=
|
||
match s with
|
||
| .left _ => barfoo s
|
||
| .right _ => test12 Lean.Server.Test.Refs.test10
|
||
|
||
def test13 (s : Sum' α β) := test11 s
|
||
--^ outgoingCallHierarchy
|