diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-08-29 07:18:08 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-08-29 07:18:08 -0700 |
commit | 7a0d983aedd8ad8f3f41a22ffa0ce4b6ab2f1523 (patch) | |
tree | e435303c2e36b38edd7cfb913306a9161a894bd2 /test/files/run | |
parent | c9ef7f5a7e76887fdab775802bc7a81994bac362 (diff) | |
parent | 9d5ed33ef9b503f20506dbe3e410960069a99d0a (diff) | |
download | scala-7a0d983aedd8ad8f3f41a22ffa0ce4b6ab2f1523.tar.gz scala-7a0d983aedd8ad8f3f41a22ffa0ce4b6ab2f1523.tar.bz2 scala-7a0d983aedd8ad8f3f41a22ffa0ce4b6ab2f1523.zip |
Merge pull request #2868 from retronym/ticket/7775
SI-7775 Harden against the shifting sands of System.getProperties
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7775.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t7775.scala b/test/files/run/t7775.scala new file mode 100644 index 0000000000..5fb0327611 --- /dev/null +++ b/test/files/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]) { + 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) + } +} |