<commit_before>package enmasse.smoketest

import io.kotlintest.specs.StringSpec
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit

/**
 * @author <NAME>
 */
class NoStoreAnycastTest: StringSpec() {
    init {
        val dest = "anycast"
        val client = EnMasseClient(createQueueContext(dest))

        "Messages should be delivered to receiver" {
            val msgs = listOf("foo", "bar", "baz")

            val executor = Executors.newFixedThreadPool(1)
            val receiver = executor.submit<Int> { client.recvMessages(dest, msgs.size).size }
            client.sendMessages(dest, msgs) shouldBe msgs.size
            println("Sent ${msgs.size} messages")

            val result = receiver.get(20, TimeUnit.SECONDS)
<commit_msg>Wait sending until receiver has started<commit_after>package enmasse.smoketest

import io.kotlintest.specs.StringSpec
import java.util.concurrent.CountDownLatch
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit

/**
 * @author <NAME>
 */
class NoStoreAnycastTest: StringSpec() {
    init {
        val dest = "anycast"
        val client = EnMasseClient(createQueueContext(dest))

        "Messages should be delivered to receiver" {
            val msgs = listOf("foo", "bar", "baz")

            val countdownLatch = CountDownLatch(1)
            val executor = Executors.newFixedThreadPool(1)
            val receiver = executor.submit<Int> { client.recvMessages(dest, msgs.size, connectListener = { countdownLatch.countDown() }).size }
            countdownLatch.await(10, TimeUnit.SECONDS)
            client.sendMessages(dest, msgs) shouldBe msgs.size
            println("Sent ${msgs.size} messages")

            val result = receiver.get(20, TimeUnit.SECONDS)

{'fraction_non_alphanumeric': 0.10550198525241067, 'fraction_numerical': 0.005104934770277935, 'mean_word_length': 3.0551724137931036, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4437758', 'n_tokens_mistral': 529, 'n_tokens_neox': 514, 'n_words': 115}