<commit_before>import scala.actors.{Futures, TIMEOUT}
import scala.actors.Actor._

object Test {

  def compute(): Option[Boolean] = {
    val fts = for (j <- 0 until 5) yield Futures.future {
      receiveWithin (100) {
        case TIMEOUT => true
        case other   => false
      }
    }
    val done = Futures.awaitAll(2000, fts.toArray: _*) // list to array, as varargs
    if (done.contains(None))
      None
    else
      Some(true)
  }

  def main(args:Array[String]) : Unit = {
    val format = new java.text.DecimalFormat("000.00'ms'")
    var iter = 1
    val done = 11
    while (iter < done) {
      val start = System.nanoTime()
      val result = compute()
      val time = System.nanoTime() - start
      result match {
        case Some(result) =>
          //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6))
          printf("Iteration %2d succeeded%n", iter)
          iter += 1
        case None =>
          printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6))
          iter = done
      }
    }
  }

}<commit_msg>Made test jvm/t2515 more robust.<commit_after>import scala.actors.{Futures, TIMEOUT}
import scala.actors.Actor._

object Test {

  def compute(): Option[Boolean] = {
    val fts = for (j <- 0 until 5) yield Futures.future {
      receiveWithin (100) {
        case TIMEOUT => true
        case other   => false
      }
    }
    val done = Futures.awaitAll(2000, fts.toArray: _*) // list to array, as varargs
    if (done.contains(None))
      None
    else
      Some(true)
  }

  def main(args:Array[String]) : Unit = {
    val ft = Futures.future {
      val format = new java.text.DecimalFormat("000.00'ms'")
      var iter = 1
      val done = 11
      while (iter < done) {
        val start = System.nanoTime()
        val result = compute()
        val time = System.nanoTime() - start
        result match {
          case Some(result) =>
            //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6))
            printf("Iteration %2d succeeded%n", iter)
            iter += 1
          case None =>
            printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6))
            iter = done
        }
      }
    }
    ft()
  }

}
{'fraction_non_alphanumeric': 0.13183000867302688, 'fraction_numerical': 0.023417172593235037, 'mean_word_length': 2.015686274509804, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849967', 'n_tokens_mistral': 780, 'n_tokens_neox': 733, 'n_words': 208}