effekt-lang / effekt-lang/effekt

Flaky errors in LSP test suite

Open
#1,110 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Scala
Stars
469
Forks
41
Avg merge
1d 16h
Merged PRs (30d)
23

Description

**Steps to reproduce:**

* Open IntelliJ
* Run all `LSPTests` (perhaps multiple times, it *is* flaky)

**Expected behavior**: all tests pass

**Observed behavior:**

The test "Server publishes list of holes in file" fails with `java.lang.IndexOutOfBoundsException: 0`.
This is caused by a spurious error from Typer when checking `char.effekt` such as:

```
PlainTextError(Wrong number of value arguments, given 0, but infixSub expects 2.,
Some(Range(Position(71,32,FileSource(/home/tim/Dev/effekt-lang/effekt3/libraries/common/char.effekt,UTF-8)),Position(71,52,FileSource(/home/tim/Dev/effekt-lang/effekt3/libraries/common/char.effekt,UTF-8)))),Error),
PlainTextError(Cannot compile dependency: /home/tim/Dev/effekt-lang/effekt3/libraries/common/char,Some(Range(Position(71,32,FileSource(/home/tim/Dev/effekt-lang/effekt3/libraries/common/char.effekt,UTF-8)),Position(71,52,FileSource(/home/tim/Dev/effekt-lang/effekt3/libraries/common/char.effekt,UTF-8)))),Error)
```

We were able to reproduce this on my Ubuntu 24.04 setup and @marzipankaiser's macOS system.
We were not able to reproduce this by running the test in isolation, running all tests in debug mode, or running it from the command line instead of using IntelliJ.

The following things made the issue go away locally (perhaps just by changing the timing behavior):

* Modifying `char.effekt`, e.g. by removing the offending line
* Running each LSP test in its own thread
* Closing the `clientOut` channel after each test execution
* Calling `System.identityHashCode(source)` in `Parser.run`

The underlying cause is not yet clear.

Similar issues have occurred in the CI such as in this run: https://github.com/effekt-lang/effekt/actions/runs/16935237406/job/48011850001
In particular, note that this affects a different test case! Commenting out a test case also sometimes led to other tests failing when trying it locally.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.