Skip to content

Commit

Permalink
bugfix: Try to fix Mill flaky test
Browse files Browse the repository at this point in the history
Looks like Mill will sometimes throw an exception which is forwarded to Metals and causes tests to hange, this should make the tests stop hanging and make retries work.
  • Loading branch information
tgodzik committed Sep 29, 2023
1 parent b511ce9 commit 177800e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/unit/src/main/scala/tests/TestingServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,11 @@ final case class TestingServer(
val handler = { refreshCount: Int =>
if (refreshCount > 0)
for {
lenses <- fullServer.codeLens(params).asScala.map(_.asScala)
lenses <- fullServer
.codeLens(params)
.asScala
.map(_.asScala)
.recover(_ => Nil)
} {
if (lenses.nonEmpty) codeLenses.trySuccess(lenses.toList)
else if (retries > 0) {
Expand Down

0 comments on commit 177800e

Please sign in to comment.