fsharp / emacs-fsharp-mode

F# Emacs mode
Apache License 2.0
205 stars 62 forks source link

xref tests occasionally fail #316

Open juergenhoetzel opened 2 years ago

juergenhoetzel commented 2 years ago

Description

xref tests occasionally fail due to a race/timing issue.

Repro steps

eldev test

Expected behavior

All tests pass

Actual behavior

 finds definition in pervasives  FAILED (347.78ms)
  finds definitions in other files of Project (11.74ms)

========================================
F# LSP Client finds definition in pervasives

Traceback (most recent call last):
  call-interactively(xref-find-definitions)
  funcall-interactively(xref-find-definitions "LSP identifier at point.")
  xref-find-definitions("LSP identifier at point.")
  xref--find-definitions("LSP identifier at point." nil)
  xref--show-defs(#[0 "\212\307\303!\203\303q\210\3101\304b0\202\210\202\210\306\305\302\"\211\204&\311\301\300\"\210\211\262)\207" ["LSP identifier at point." definitions "LSP identifier at point." #<buffer Program.fs> 260 eglot xref-backend-definitions buffer-live-p (error) xref--not-found-error] 4] nil)
  xref-show-definitions-buffer(#[0 "\212\307\303!\203\303q\210\3101\304b0\202\210\202\210\306\305\302\"\211\204&\311\301\300\"\210\211\262)\207" ["LSP identifier at point." definitions "LSP identifier at point." #<buffer Program.fs> 260 eglot xref-backend-definitions buffer-live-p (error) xref--not-found-error] 4] ((window . #<window 4 on FileTwo.fs>) (display-action) (auto-jump)))
error: (wrong-type-argument listp t)

Ran 20 specs, 1 failed, in 16.50s.

Known workarounds

rerun tests

Related information

All systems in Build matrix

juergenhoetzel commented 2 years ago

Related fsautocompleteoutput:

[stderr] [22:53:26.843 ERR] [LSP] PositionHandler - Failed during child operation on file /home/juergen/ghq/github.com/fsharp/emacs-fsharp-mode/test/Test1/Program.fs
[stderr] System.IndexOutOfRangeException: Index was outside the bounds of the array.
[stderr]    at <StartupCode$FsAutoComplete-Core>.$FileSystem.TryGetPrevChar@213.Invoke(Position np) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.Core/FileSystem.fs:line 213
[stderr]    at Microsoft.FSharp.Core.OptionModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpOption`1 option) in D:\a\_work\1\s\src\fsharp\FSharp.Core\option.fs:line 53
[stderr]    at FsAutoComplete.SignatureHelp.loop@231-22(NamedText lines, Char ch, Position pos) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.Core/SignatureHelp.fs:line 232
[stderr]    at FsAutoComplete.SignatureHelp.getSignatureHelpFor@230.Invoke(Unit unitVar) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.Core/SignatureHelp.fs:line 240
[stderr]    at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 447
[stderr]    at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104