aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t7775.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t7775.scala')
-rw-r--r--tests/run/t7775.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run/t7775.scala b/tests/run/t7775.scala
new file mode 100644
index 000000000..bc6a67d0e
--- /dev/null
+++ b/tests/run/t7775.scala
@@ -0,0 +1,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]): Unit = {
+ 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)
+ }
+}