summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2022-02-03 10:45:59 +0100
committerGitHub <noreply@github.com>2022-02-03 10:45:59 +0100
commit5005e5410e284b873e9965d74fbc0f0974187a4f (patch)
tree2cae352cd86ae2f56fdbf26e537ea21c948d0b76 /messagebus
parent6aeb23317adf63eeb8631f643855f85f0657acfb (diff)
parentd0d4cc82afe9aa889ceb634d20dcd53723fff7c1 (diff)
Merge pull request #21047 from vespa-engine/jonmv/less-test-repetitions
Run dynamic throttling tests fewer times by default
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java b/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
index b73dc52152a..13a4e154122 100644
--- a/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
+++ b/messagebus/src/test/java/com/yahoo/messagebus/DynamicThrottlePolicyTest.java
@@ -97,10 +97,10 @@ public class DynamicThrottlePolicyTest {
/** Sort of a dummy test, as the conditions are perfect. In a more realistic scenario, below, the algorithm needs luck to climb this high. */
@Test
public void singlePolicySingleWorkerWithIncreasingParallelism() {
- for (int i = 0; i < 4; i++) {
+ for (int exponent = 0; exponent < 4; exponent++) {
CustomTimer timer = new CustomTimer();
DynamicThrottlePolicy policy = new DynamicThrottlePolicy(timer);
- int scaleFactor = (int) Math.pow(10, i);
+ int scaleFactor = (int) Math.pow(10, exponent);
long operations = 3_000L * scaleFactor;
int workPerSuccess = 6;
int numberOfWorkers = 1;
@@ -120,10 +120,10 @@ public class DynamicThrottlePolicyTest {
/** A more realistic test, where throughput gradually flattens with increasing window size, and with more variance in throughput. */
@Test
public void singlePolicyIncreasingWorkersWithNoParallelism() {
- for (int i = 0; i < 4; i++) {
+ for (int exponent = 0; exponent < 4; exponent++) {
CustomTimer timer = new CustomTimer();
DynamicThrottlePolicy policy = new DynamicThrottlePolicy(timer);
- int scaleFactor = (int) Math.pow(10, i);
+ int scaleFactor = (int) Math.pow(10, exponent);
long operations = 2_000L * scaleFactor;
// workPerSuccess determines the latency of the simulated server, which again determines the impact of the
// synthetic attractors of the algorithm, around latencies which give (close to) integer log10(1 / latency).
@@ -143,14 +143,14 @@ public class DynamicThrottlePolicyTest {
double maxMaxPending = numberOfWorkers * maximumTasksPerWorker;
assertInRange(minMaxPending, summary.averagePending, maxMaxPending);
assertInRange(minMaxPending, summary.averageWindows[0], maxMaxPending);
- assertInRange(1, summary.inefficiency, 1 + 0.25 * i); // Even slower ramp-up.
+ assertInRange(1, summary.inefficiency, 1 + 0.25 * exponent); // Even slower ramp-up.
assertInRange(0, summary.waste, 0);
}
}
@Test
public void twoWeightedPoliciesWithUnboundedTaskQueue() {
- for (int i = 0; i < 10; i++) {
+ for (int repeat = 0; repeat < 3; repeat++) {
long operations = 1_000_000;
int workPerSuccess = 6 + (int) (30 * Math.random());
int numberOfWorkers = 1 + (int) (10 * Math.random());
@@ -174,7 +174,7 @@ public class DynamicThrottlePolicyTest {
@Test
public void tenPoliciesVeryParallelServerWithShortTaskQueue() {
- for (int i = 0; i < 10; i++) {
+ for (int repeat = 0; repeat < 2; repeat++) {
long operations = 1_000_000;
int workPerSuccess = 6;
int numberOfWorkers = 6;