Skip to content

Commit

Permalink
improvement: Retry mill DAP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Oct 10, 2024
1 parent f81d76a commit 8ecabe5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class MillBreakpointDapSuite
MillBuildLayout,
) {

// mill sometimes hangs and doesn't return main classes
override protected val retryTimes: Int = 2

override def serverConfig: MetalsServerConfig =
super.serverConfig.copy(debugServerStartTimeout = 360)
super.serverConfig.copy(debugServerStartTimeout = 120)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class MillDebugDiscoverySuite
private val fooPath = "a/test/src/Foo.scala"
private val barPath = "a/test/src/Bar.scala"

// mill sometimes hangs and doesn't return main classes
override protected val retryTimes: Int = 2

for (scala <- List(scalaVersion, scala3)) {

test(s"testTarget-$scala") {
Expand Down
3 changes: 3 additions & 0 deletions tests/slow/src/test/scala/tests/mill/MillStepDapSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class MillStepDapSuite
MillBuildLayout,
) {

// mill sometimes hangs and doesn't return main classes
override protected val retryTimes: Int = 2

// otherwise we get both Scala 2.12 and 2.13 dependencies, which is more tricky for the tests
override def scalaVersion: String = BuildInfo.scala212

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/src/main/scala/tests/BaseDapSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ abstract class BaseDapSuite(
override def serverConfig: MetalsServerConfig =
super.serverConfig.copy(loglevel = "debug")

protected val retryTimes = 0

override def beforeEach(context: BeforeEach): Unit = {
super.beforeEach(context)
dapClient.touch()
Expand Down Expand Up @@ -102,7 +104,7 @@ abstract class BaseDapSuite(
)(
source: String
)(implicit loc: Location): Unit = {
test(name) {
test(name, maxRetry = retryTimes) {
cleanWorkspace()
val debugLayout = DebugWorkspaceLayout(source, workspace)
val workspaceLayout = buildToolLayout(debugLayout.toString, scalaVersion)
Expand Down

0 comments on commit 8ecabe5

Please sign in to comment.