Skip to content

Commit 6453328

Browse files
committed
chore: Retry code actions for Scala CLi diags
I must have lost it during one of the rebases
1 parent 6c2bbf5 commit 6453328

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

tests/slow/src/main/scala/tests/scalacli/BaseScalaCLIActionSuite.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class BaseScalaCLIActionSuite(name: String)
6666
changeFile: String => String = identity,
6767
expectError: Boolean = false,
6868
filterAction: CodeAction => Boolean = _ => true,
69+
retryAction: Int = 0,
6970
)(implicit loc: Location): Unit = {
7071

7172
val path = toPath(fileName)
@@ -95,7 +96,8 @@ class BaseScalaCLIActionSuite(name: String)
9596
changeFile,
9697
expectError,
9798
filterAction,
98-
overrideLayout = layout,
99+
layout,
100+
retryAction,
99101
)
100102
}
101103
}

tests/slow/src/test/scala/tests/scalacli/ScalaCliActionsSuite.scala

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class ScalaCliActionsSuite
2828
val coursierComplete = new CoursierComplete(scalaCompilerVersion)
2929
val newestOsLib: String = coursierComplete
3030
.complete("com.lihaoyi::os-lib:")
31+
.filterNot(_.contains("M"))
3132
.headOption
3233
.map(_.stripPrefix(":"))
3334
.getOrElse("0.8.1")
@@ -53,6 +54,7 @@ class ScalaCliActionsSuite
5354
scalaCliOptions = List("--actions", "-S", scalaVersion),
5455
expectNoDiagnostics = false,
5556
selectedActionIndex = 1,
57+
retryAction = 5,
5658
)
5759

5860
checkScalaCLI(
@@ -83,6 +85,7 @@ class ScalaCliActionsSuite
8385
scalaCliOptions = List("--actions", "-S", scalaVersion),
8486
expectNoDiagnostics = false,
8587
selectedActionIndex = 1,
88+
retryAction = 5,
8689
)
8790

8891
checkNoActionScalaCLI(

tests/unit/src/main/scala/tests/codeactions/BaseCodeActionLspSuite.scala

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ abstract class BaseCodeActionLspSuite(
138138
.recoverWith {
139139
case _: Throwable if retry > 0 =>
140140
Thread.sleep(2000)
141+
scribe.debug("Retrying code actions")
141142
assertCodeAction(retry - 1)
142143
case _: Throwable if expectError =>
143144
Future.successful(Nil)

0 commit comments

Comments
 (0)