summaryrefslogtreecommitdiff
path: root/test/files/run/t7775.scala
blob: 48b0d899748dffe04ec030244b7ce970dd441010 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import scala.concurrent.{duration, Future, Await, ExecutionContext}
import scala.tools.nsc.Settings
import ExecutionContext.Implicits.global

// Was failing pretty regularly with a ConcurrentModificationException as
// WrappedProperties#systemProperties iterated directly over the mutable
// global system properties map.
object Test {
  def main(args: Array[String]) {
    val tries = 1000 // YMMV
    val compiler = Future {
      for(_ <- 1 to tries) new Settings(_ => {})
    }
    for(i <- 1 to tries * 10) System.setProperty(s"foo$i", i.toString)
    Await.result(compiler, duration.Duration.Inf)
  }
}