Skip to content

Commit c729035

Browse files
authored
Merge pull request #12119 from dotty-staging/disable-flaky2
Backport: Set file filter correctly
2 parents aed8a87 + 20f8308 commit c729035

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

compiler/test/dotty/tools/dotc/IdempotencyTests.scala

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ class IdempotencyTests {
1818
import IdempotencyTests._
1919
import CompilationTest.aggregateTests
2020

21+
// Flaky test on Windows
22+
// https://github.com/lampepfl/dotty/issues/11885
23+
val filter = FileFilter.exclude("i6507b")
24+
2125
@Category(Array(classOf[SlowTests]))
2226
@Test def idempotency: Unit = {
2327
implicit val testGroup: TestGroup = TestGroup("idempotency")
2428
val opt = defaultOptions
2529

2630
val posIdempotency = aggregateTests(
27-
compileFilesInDir("tests/pos", opt)(TestGroup("idempotency/posIdempotency1")),
28-
compileFilesInDir("tests/pos", opt)(TestGroup("idempotency/posIdempotency2")),
31+
compileFilesInDir("tests/pos", opt, filter)(TestGroup("idempotency/posIdempotency1")),
32+
compileFilesInDir("tests/pos", opt, filter)(TestGroup("idempotency/posIdempotency2")),
2933
)
3034

3135
val orderIdempotency = {

compiler/test/dotty/tools/vulpix/FileFilter.scala

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ sealed trait FileFilter {
55
}
66

77
object FileFilter {
8+
def exclude(file: String): FileFilter = exclude(file :: Nil)
9+
10+
def exclude(file: String, files: String*): FileFilter =
11+
exclude(file :: files.toList)
812

913
def exclude(files: List[String]): FileFilter = new FileFilter {
1014
private val blackList = files.toSet

tests/idempotency/IdempotencyCheck.scala

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ import java.util.stream.Stream as JStream
66
import scala.collection.JavaConverters.*
77

88
object IdempotencyCheck {
9-
val blacklisted = Set(
10-
// No fix needed. Bridges on collections in different order. Second one in scala2 order.
11-
s"pos{JFile.separator}Map{JFile.separator}scala{JFile.separator}collection{JFile.separator}immutable/Map",
12-
s"pos{JFile.separator}Map{JFile.separator}scala{JFile.separator}collection{JFile.separator}immutable{JFile.separator}AbstractMap",
13-
s"pos{JFile.separator}t1203a/NodeSeq",
14-
s"pos{JFile.separator}i2345{JFile.separator}Whatever"
15-
)
16-
179
def checkIdempotency(dir1: String, dir2: String): Unit = {
1810
var failed = 0
1911
var total = 0
@@ -26,14 +18,14 @@ object IdempotencyCheck {
2618
val bytecodeFiles = {
2719
def bytecodeFiles(paths: JStream[JPath], dir: String): List[(String, JPath)] = {
2820
def isBytecode(file: String) = file.endsWith(".class") || file.endsWith(".tasty")
29-
def tupleWithName(f: JPath) = (f.toString.substring(dir.length + 1, f.toString.length - 6), f)
21+
def tupleWithName(f: JPath) = (f.toString.substring(dir.length, f.toString.length - 6), f)
3022
paths.iterator.asScala.filter(path => isBytecode(path.toString)).map(tupleWithName).toList
3123
}
3224
bytecodeFiles(JFiles.walk(dir1Path), dir1String) ++ bytecodeFiles(JFiles.walk(dir2Path), dir2String)
3325
}
3426
val groups = bytecodeFiles.groupBy(_._1).mapValues(_.map(_._2))
3527

36-
groups.filterNot(x => blacklisted(x._1)).iterator.flatMap { g =>
28+
groups.iterator.flatMap { g =>
3729
def pred(f: JPath, dir: String, isTasty: Boolean) =
3830
f.toString.contains(dir) && f.toString.endsWith(if (isTasty) ".tasty" else ".class")
3931
val class1 = g._2.find(f => pred(f, dir1String, isTasty = false))

0 commit comments

Comments
 (0)