<commit_before>package io.ino.solrs

import java.net.ConnectException
import java.util.concurrent.{ExecutionException, TimeUnit, TimeoutException}

import org.asynchttpclient.{DefaultAsyncHttpClient, DefaultAsyncHttpClientConfig}
import org.apache.catalina.LifecycleState
import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.mockito.MockitoSugar
import org.scalatest.{BeforeAndAfterEach, FunSpec, Matchers}
import org.scalatest.concurrent.IntegrationPatience

import scala.concurrent.duration._
import scala.language.postfixOps
import scala.concurrent.ExecutionContext.Implicits.global

class PingStatusObserverIntegrationSpec extends FunSpec with RunningSolr with Eventually with IntegrationPatience with BeforeAndAfterEach with Matchers with FutureAwaits with MockitoSugar {

  private implicit val awaitTimeout = 2000 millis
  private val httpClientTimeout = 20
  private val httpClient = new DefaultAsyncHttpClient(new DefaultAsyncHttpClientConfig.Builder().setRequestTimeout(httpClientTimeout).build)

  private lazy val solrUrl = s"http://localhost:${solrRunner.port}/solr/collection1"

  override def beforeEach() {
    eventually {
      enable(solrUrl).getStatusCode shouldBe 200<commit_msg>Attempt to stabilize flaky PingStatusObserverIntegrationSpec<commit_after>package io.ino.solrs

import java.net.ConnectException
import java.util.concurrent.{ExecutionException, TimeUnit, TimeoutException}

import org.asynchttpclient.{DefaultAsyncHttpClient, DefaultAsyncHttpClientConfig}
import org.apache.catalina.LifecycleState
import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.mockito.MockitoSugar
import org.scalatest.{BeforeAndAfterEach, FunSpec, Matchers}
import org.scalatest.concurrent.IntegrationPatience

import scala.concurrent.duration._
import scala.language.postfixOps
import scala.concurrent.ExecutionContext.Implicits.global

class PingStatusObserverIntegrationSpec extends FunSpec with RunningSolr with Eventually with IntegrationPatience with BeforeAndAfterEach with Matchers with FutureAwaits with MockitoSugar {

  private implicit val awaitTimeout = 2000 millis
  private val httpClientTimeout = 100
  private val httpClient = new DefaultAsyncHttpClient(new DefaultAsyncHttpClientConfig.Builder().setRequestTimeout(httpClientTimeout).build)

  private lazy val solrUrl = s"http://localhost:${solrRunner.port}/solr/collection1"

  override def beforeEach() {
    eventually {
      enable(solrUrl).getStatusCode shouldBe 200
{'fraction_non_alphanumeric': 0.06399383191981496, 'fraction_numerical': 0.008095605242868157, 'mean_word_length': 7.238095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1565536', 'n_tokens_mistral': 715, 'n_tokens_neox': 683, 'n_words': 157}