mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
post-merge fix-ups
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>mvn-defaults</artifactId>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<relativePath>../mvn-defaults</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>drivers-api</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -85,7 +85,7 @@
|
||||
<dependency>
|
||||
<groupId>io.nosqlbench</groupId>
|
||||
<artifactId>engine-clients</artifactId>
|
||||
<version>4.15.48-SNAPSHOT</version>
|
||||
<version>4.15.51-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -98,7 +98,6 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
||||
*/
|
||||
public synchronized void startActivity() {
|
||||
logger.info("starting activity " + activity.getAlias() + " for cycles " + activity.getCycleSummary());
|
||||
this.annotatedCommand = annotatedCommand;
|
||||
Annotators.recordAnnotation(Annotation.newBuilder()
|
||||
.session(sessionId)
|
||||
.now()
|
||||
@@ -248,7 +247,6 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
||||
return wasStopped;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Listens for changes to parameter maps, maps them to the activity instance, and notifies all eligible listeners of
|
||||
* changes.
|
||||
@@ -256,9 +254,7 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
||||
@Override
|
||||
public synchronized void handleParameterMapUpdate(ParameterMap parameterMap) {
|
||||
|
||||
if (activity instanceof ActivityDefObserver) {
|
||||
activity.onActivityDefUpdate(activityDef);
|
||||
}
|
||||
activity.onActivityDefUpdate(activityDef);
|
||||
|
||||
// An activity must be initialized before the motors and other components are
|
||||
// considered ready to handle parameter map changes. This is signaled in an activity
|
||||
@@ -423,8 +419,6 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
||||
* @return true, if the desired SlotState was detected
|
||||
*/
|
||||
private boolean awaitMotorState(Motor m, int waitTime, int pollTime, RunState... desiredRunStates) {
|
||||
Set<RunState> desiredStates = new HashSet<>(Arrays.asList(desiredRunStates));
|
||||
|
||||
long startedAt = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() < (startedAt + waitTime)) {
|
||||
Map<RunState, Integer> actualStates = new HashMap<>();
|
||||
@@ -434,11 +428,11 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
||||
for (RunState desiredRunState : desiredRunStates) {
|
||||
actualStates.remove(desiredRunState);
|
||||
}
|
||||
logger.trace("state of remaining slots:" + actualStates.toString());
|
||||
logger.trace("state of remaining slots:" + actualStates);
|
||||
if (actualStates.size() == 0) {
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("motor states:" + actualStates.toString());
|
||||
System.out.println("motor states:" + actualStates);
|
||||
try {
|
||||
Thread.sleep(pollTime);
|
||||
} catch (InterruptedException ignored) {
|
||||
|
||||
@@ -383,9 +383,8 @@ public class ScenarioController {
|
||||
* @param waitTimeMillis The time to wait, usually set very high
|
||||
* @return true, if all activities completed before the timer expired, false otherwise
|
||||
*/
|
||||
public boolean awaitCompletion(int waitTimeMillis) {
|
||||
public boolean awaitCompletion(long waitTimeMillis) {
|
||||
boolean completed = true;
|
||||
long waitstart = System.currentTimeMillis();
|
||||
long remaining = waitTimeMillis;
|
||||
|
||||
List<ActivityFinisher> finishers = new ArrayList<>();
|
||||
@@ -410,7 +409,6 @@ public class ScenarioController {
|
||||
}
|
||||
|
||||
return completed;
|
||||
|
||||
}
|
||||
|
||||
private ActivityDef aliasToDef(String alias) {
|
||||
|
||||
@@ -311,7 +311,7 @@ public class Scenario implements Callable<ScenarioResult> {
|
||||
endedAtMillis = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
int awaitCompletionTime = 86400 * 365 * 1000;
|
||||
long awaitCompletionTime = 86400 * 365 * 1000L;
|
||||
logger.debug("Awaiting completion of scenario for " + awaitCompletionTime + " millis.");
|
||||
scenarioController.awaitCompletion(awaitCompletionTime);
|
||||
//TODO: Ensure control flow covers controller shutdown in event of internal error.
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ScenariosExecutor {
|
||||
}
|
||||
Map<Scenario, ScenarioResult> scenarioResultMap = new LinkedHashMap<>();
|
||||
getAsyncResultStatus()
|
||||
.entrySet().forEach(es -> scenarioResultMap.put(es.getKey(), es.getValue().orElseGet(null)));
|
||||
.entrySet().forEach(es -> scenarioResultMap.put(es.getKey(), es.getValue().orElse(null)));
|
||||
return new ScenariosResults(this, scenarioResultMap);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import io.nosqlbench.engine.api.activityimpl.motor.CoreMotorDispenser;
|
||||
import io.nosqlbench.engine.core.lifecycle.ActivityExecutor;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.nosqlbench.engine.core.fortesting.BlockingSegmentInput;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import io.nosqlbench.engine.api.activityimpl.SimpleActivity;
|
||||
import io.nosqlbench.engine.api.activityimpl.motor.CoreMotor;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicLongArray;
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.nosqlbench.engine.core;
|
||||
|
||||
import io.nosqlbench.engine.api.scripting.ScriptEnvBuffer;
|
||||
import io.nosqlbench.engine.core.script.Scenario;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.nosqlbench.engine.core.experimental;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.nosqlbench.engine.core.metrics;
|
||||
|
||||
import com.codahale.metrics.Timer;
|
||||
import io.nosqlbench.engine.api.metrics.DeltaHdrHistogramReservoir;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class NBMetricsSummaryTest {
|
||||
|
||||
NBMetricsSummary.summarize(sb, "test", timer);
|
||||
|
||||
System.out.println(sb.toString());
|
||||
System.out.println(sb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.nosqlbench.engine.core.script;
|
||||
|
||||
import io.nosqlbench.engine.api.scripting.ScriptEnvBuffer;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
package io.nosqlbench.engine.core.script;
|
||||
|
||||
import io.nosqlbench.engine.core.lifecycle.ScenariosResults;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ScenariosExecutorTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Disabled
|
||||
public void testAwaitOnTime() {
|
||||
ScenariosExecutor e = new ScenariosExecutor(ScenariosExecutorTest.class.getSimpleName(), 1);
|
||||
Scenario s = new Scenario("testing", Scenario.Engine.Graalvm,"stdout:3000");
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
package io.nosqlbench.engine.core.script;
|
||||
|
||||
import io.nosqlbench.nb.api.errors.BasicError;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
public class ScriptParamsTest {
|
||||
|
||||
@Test(expected = BasicError.class)
|
||||
@Test
|
||||
public void testThatNullOverridesKeyThrowsBasicError() {
|
||||
ScriptParams p = new ScriptParams();
|
||||
p.putAll(Map.of("a","b"));
|
||||
p.withDefaults(Map.of("c","d"));
|
||||
HashMap<String, String> overrides = new HashMap<>();
|
||||
overrides.put(null,"test");
|
||||
p.withOverrides(overrides);
|
||||
assertThatExceptionOfType(BasicError.class)
|
||||
.isThrownBy(() -> p.withOverrides(overrides));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user