diff --git a/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/DistributionTest.kt b/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/DistributionTest.kt index 75a9749d70..0d853d9d9c 100644 --- a/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/DistributionTest.kt +++ b/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/DistributionTest.kt @@ -18,8 +18,8 @@ import it.unibo.alchemist.boundary.grid.cluster.ClusterImpl import it.unibo.alchemist.test.utils.DistributionTestUtils import it.unibo.alchemist.test.utils.DistributionTestUtils.startServers import it.unibo.alchemist.test.utils.DistributionTestUtils.use -import it.unibo.alchemist.test.utils.TestConstants.BATCH_SIZE import it.unibo.alchemist.test.utils.TestConstants.SERVERS_TO_LAUNCH +import it.unibo.alchemist.test.utils.TestConstants.SIMULATION_BATCH_SIZE import it.unibo.alchemist.test.utils.TestConstants.clientConfigFile import it.unibo.alchemist.test.utils.TestConstants.composeFilePath import it.unibo.alchemist.test.utils.TestConstants.registry @@ -39,7 +39,7 @@ class DistributionTest : StringSpec({ registry.simulations().size == 1 } val simulationID = registry.simulations().first() - registry.simulationJobs(simulationID) shouldHaveSize BATCH_SIZE + registry.simulationJobs(simulationID) shouldHaveSize SIMULATION_BATCH_SIZE } } } @@ -57,7 +57,7 @@ class DistributionTest : StringSpec({ servers.first().close() eventually(15.seconds) { registry.simulationAssignments(simulationID).keys shouldHaveSize SERVERS_TO_LAUNCH - 1 - registry.assignedJobs(registry.nodes.first().serverID) shouldHaveSize BATCH_SIZE + registry.assignedJobs(registry.nodes.first().serverID) shouldHaveSize SIMULATION_BATCH_SIZE } } } diff --git a/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/utils/TestConstants.kt b/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/utils/TestConstants.kt index 74901afd3e..4ca4c7dce5 100644 --- a/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/utils/TestConstants.kt +++ b/alchemist-grid/src/test/kotlin/it/unibo/alchemist/test/utils/TestConstants.kt @@ -15,14 +15,13 @@ import java.nio.file.Path object TestConstants { const val SERVERS_TO_LAUNCH = 2 - private val ETCD_SERVER_ENDPOINTS = - listOf("http://localhost:10001", "http://localhost:10003", "http://localhost:10003") - private val etcdKVStore = EtcdKVStore(ETCD_SERVER_ENDPOINTS) - val registry = ObservableClusterRegistry(etcdKVStore) + val registry = ObservableClusterRegistry( + EtcdKVStore(listOf("http://localhost:10001", "http://localhost:10003", "http://localhost:10003")), + ) val serverConfigFile = Path.of("src", "test", "resources", "server-config.yml").toString() val clientConfigFile = Path.of("src", "test", "resources", "client-config.yml").toString() + const val SIMULATION_BATCH_SIZE = 4 val distributionConfigurationFile = Path.of("src", "test", "resources", "distribution-config.yml").toString() val composeFilePath = Path.of("src", "test", "resources", "docker-compose.yml").toString() - const val BATCH_SIZE = 4 }