<commit_before>object Test {
  def main(args: Array[String]): Unit = {
    import scala.concurrent._
    import ExecutionContext.Implicits.global
    val source1 = Promise[Int]()
    val source2 = Promise[Int]()
    source2.completeWith(source1.future).future.onComplete {
      case _ => print("success")
    }
    source2.tryFailure(new TimeoutException)
    source1.success(123)
  }
}<commit_msg>[backport] SI-8689 Make a Future test case determistic<commit_after>object Test {
  def main(args: Array[String]): Unit = {
    import scala.concurrent._
    import ExecutionContext.Implicits.global
    val source1 = Promise[Int]()
    val source2 = Promise[Int]()
    val done = Promise[Unit]()
    source2.completeWith(source1.future).future.onComplete {
      case _ =>
         print("success")
         done.success(())
    }
    source2.tryFailure(new TimeoutException)
    source1.success(123)
    import duration._
    Await.result(done.future, 120.seconds)
  }
}
{'fraction_non_alphanumeric': 0.11958762886597939, 'fraction_numerical': 0.02577319587628866, 'mean_word_length': 3.3936651583710407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5419207', 'n_tokens_mistral': 313, 'n_tokens_neox': 299, 'n_words': 59}