Description
update
=>IsEvaluating is running and already get the files for evaluations,
=>enqeueue file for evaluation
=>setSomethingModified dirty the IsEvaluating key in shakeExtre
=>IsEvaluating is finished, diry key removed from shakeExtra
=>session restarting and flushing the dirty keys of shakeExtra to hls-graph database
=>IsEvaluating is not updating since hls-graph database do not know it is dirty.
=======================
This is the issue discovered by @jhrcek
we can run the test
cabal test hls-eval-plugins-test --test-options="-p /:i behaves exactly the same as :info/"
Today I spent some time looking into flaky test failures in CI.
Downloaded the logs from all failed testing jobs over the past 14 days.
The good news is that there are like 10 tests that keep failing relatively often, so fixing some of those could significantly reduce the overall flakiness :)
One of the most frequently failing tests is this group of tests whose failures have the same root cause.
They essentially run bunch of eval plugin's code lenses and then wait for workspace/applyEdit message from the server, which very often comes, but from time to time (can reproduce this in like once every 10 runs) it doesn't come. In such cases there is this error in server logs:
2024-02-13T12:32:05.980696Z | Error | eval: Internal Error: BadDependency "GetLinkable"
Few lines before that there's this: diagnostic message: "message": "/home/jhrcek/.cache/ghcide/test-0.1.0.0-inplace-05a647850b95fcd2b14858d164f368e84f7f8463/TI_Info.hi.core: getFileStatus: does not exist (No such file or directory)",
There's only one usage of this this GetLinkable thing in eval plugin here
I'm pretty sure the "file doesn't exist" exception is coming from this line
This merge from @wz1000 alleviate the situation #4076
but
In the end I got the (improved) error after 180 iterations of running that test. But it seems to occur less frequently now.
"message": "called GetLinkable for a file without a linkable: NormalizedFilePath "/tmp/extra-dir-10246150986263/TI_Info.hs"\nCallStack (from HasCallStack):\n error, called at src/Development/IDE/Core/Rules.hs:1120:18 in ghcide-2.6.0.0-inplace:Development.IDE.Core.Rules"
@wz1000 point out it may orgins from #3423, we trying to fix #3423 in pr #4087
but @jhrcek reported the error of GetLinkable
still exist in the test.
Ok, I executed the flaky eval tests 500x from master and then 500x from Patricks PR. It doesn't seem to improve the situation significantly.
On master 2 of 500 test runs failed with GetLinkable error.
On the PR branch 6 of 500 test runs failed with that error.