From 8ec9300ab66c925d620e333efdd7c911d5220929 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Sun, 5 Feb 2023 19:48:55 -0600 Subject: [PATCH 1/6] adding local tags cleanup script --- scripts/.delete-tags | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/.delete-tags diff --git a/scripts/.delete-tags b/scripts/.delete-tags new file mode 100755 index 000000000..e4926f0b2 --- /dev/null +++ b/scripts/.delete-tags @@ -0,0 +1,28 @@ +#!/bin/bash +printf "WARNING:\n" +printf " This will remove any tags which were known to be stale as of 5.17.0\n" +printf " Only these will be kept:\n" +printf " - 5.*\n" +printf " - nb-5.*\n" +printf " - nosqlbench-5.*\n" +printf " - nosqlbench-4.17.20+\n" +printf " - nosqlbench-4.15.100+\n" +printf " FURTHER: This removes all your local tags first and then synchronizes\n" +printf " from origin. If you have any special tags only on local, it will remove them.\n" +printf " If you do NOT want to do this, hit crtl-c now!\n" +read response + +#delete all the remote tags with the pattern your looking for ... +git tag \ +| grep -v '5\.' \ +| grep -v 'nosqlbench-5\.' \ +| grep -v 'nb-5\.' \ +| grep -v 'nosqlbench-4\.17\.[23][0-9]' \ +| grep -v 'nosqlbench-4\.15\.10[0-9]' \ +| xargs -n 1 -I% git push origin :refs/tags/% + +# delete all your local tags +git tag | xargs -I% git tag -d % + +# fetch the remote tags which still remain +git fetch From 58c4de8122afef85b1b0a41e5f8ab0b0d073380d Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Sun, 5 Feb 2023 20:53:05 -0600 Subject: [PATCH 2/6] typo fix --- .../nosqlbench/engine/api/activityimpl/motor/RunStateImage.java | 2 +- .../engine/api/activityimpl/motor/RunStateImageTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImage.java b/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImage.java index 6ea534910..a37b49b34 100644 --- a/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImage.java +++ b/engine-api/src/main/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImage.java @@ -53,7 +53,7 @@ public class RunStateImage { return true; } - public boolean isNonOther(RunState... runStates) { + public boolean isNoneOther(RunState... runStates) { int[] scan = Arrays.copyOf(counts, counts.length); for (RunState runState : runStates) { scan[runState.ordinal()]=0; diff --git a/engine-api/src/test/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImageTest.java b/engine-api/src/test/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImageTest.java index 10e3aed76..2084f90d4 100644 --- a/engine-api/src/test/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImageTest.java +++ b/engine-api/src/test/java/io/nosqlbench/engine/api/activityimpl/motor/RunStateImageTest.java @@ -33,7 +33,7 @@ public class RunStateImageTest { assertThat(image.is(RunState.Starting)).isTrue(); assertThat(image.isTimeout()).isFalse(); assertThat(image.is(RunState.Errored)).isFalse(); - assertThat(image.isNonOther(RunState.Starting, RunState.Running)).isTrue(); + assertThat(image.isNoneOther(RunState.Starting, RunState.Running)).isTrue(); RunState maxState = image.getMaxState(); assertThat(maxState).isEqualTo(RunState.values()[RunState.Running.ordinal()]); RunState minState = image.getMinState(); From ce54eced7e218eaff799fd0c63a917afbe9514bf Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Sun, 5 Feb 2023 21:20:10 -0600 Subject: [PATCH 3/6] logically isolate concurrent concurrency tests --- .../engine/core/lifecycle/activity/ActivityExecutor.java | 2 +- .../io/nosqlbench/engine/core/ActivityExecutorTest.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityExecutor.java b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityExecutor.java index f17c60b94..57bee9d53 100644 --- a/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityExecutor.java +++ b/engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityExecutor.java @@ -280,7 +280,7 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen } } - private void alignMotorStateToIntendedActivityState() { + private synchronized void alignMotorStateToIntendedActivityState() { RunState intended = activity.getRunState(); logger.trace(() -> "ADJUSTING to INTENDED " + intended); switch (intended) { diff --git a/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java b/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java index 176d53880..edb3cd3b9 100644 --- a/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java +++ b/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java @@ -47,7 +47,7 @@ class ActivityExecutorTest { @Test synchronized void testRestart() { - ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test;cycles=1000;op=initdelay:initdelay=5000;"); + ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-restart;cycles=1000;cyclerate=1;op=initdelay:initdelay=5000;"); new ActivityTypeLoader().load(activityDef); final Activity activity = new DelayedInitActivity(activityDef); @@ -67,6 +67,7 @@ class ActivityExecutorTest { try { activityDef.setThreads(1); activityExecutor.startActivity(); + Thread.sleep(500L); activityExecutor.stopActivity(); activityExecutor.startActivity(); activityExecutor.stopActivity(); @@ -82,7 +83,7 @@ class ActivityExecutorTest { @Test synchronized void testDelayedStartSanity() { - final ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test;cycles=1000;initdelay=2000;"); + final ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-delayed-start;cycles=1000;initdelay=2000;"); new ActivityTypeLoader().load(activityDef); final Activity activity = new DelayedInitActivity(activityDef); @@ -118,7 +119,7 @@ class ActivityExecutorTest { @Test synchronized void testNewActivityExecutor() { - ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test;cycles=1000;initdelay=5000;"); + ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-dynamic-params;cycles=1000;initdelay=5000;"); new ActivityTypeLoader().load(activityDef); getActivityMotorFactory(motorActionDelay(999), new AtomicInput(activityDef)); From d3d7e36bbfe14cef6a36c61c085868e63e213a96 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Mon, 6 Feb 2023 00:20:25 -0600 Subject: [PATCH 4/6] removed extraneous test --- .../core/experimental/CompletableTests.java | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 engine-core/src/test/java/io/nosqlbench/engine/core/experimental/CompletableTests.java diff --git a/engine-core/src/test/java/io/nosqlbench/engine/core/experimental/CompletableTests.java b/engine-core/src/test/java/io/nosqlbench/engine/core/experimental/CompletableTests.java deleted file mode 100644 index e57bf6505..000000000 --- a/engine-core/src/test/java/io/nosqlbench/engine/core/experimental/CompletableTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2022 nosqlbench - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.nosqlbench.engine.core.experimental; - -import org.junit.jupiter.api.Test; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class CompletableTests { - - @Test - public void testCompletionStages() { - CompletableFuture f = new CompletableFuture<>(); - ExecutorService executorService = Executors.newCachedThreadPool(); - CompletableFuture objectCompletableFuture = f.completeAsync(() -> "foo", executorService); - boolean bar = objectCompletableFuture.complete("bar"); - - } -} From 5626430de8f8b7ec9781d9aa2f7c30a89f0c9b45 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Mon, 6 Feb 2023 12:07:25 -0600 Subject: [PATCH 5/6] disable unused edge case test until it is well defined --- .../engine/core/ActivityExecutorTest.java | 71 ++++++++++--------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java b/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java index edb3cd3b9..fe34d72e7 100644 --- a/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java +++ b/engine-core/src/test/java/io/nosqlbench/engine/core/ActivityExecutorTest.java @@ -45,40 +45,43 @@ import static org.assertj.core.api.Assertions.fail; class ActivityExecutorTest { private static final Logger logger = LogManager.getLogger(ActivityExecutorTest.class); - @Test - synchronized void testRestart() { - ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-restart;cycles=1000;cyclerate=1;op=initdelay:initdelay=5000;"); - new ActivityTypeLoader().load(activityDef); - - final Activity activity = new DelayedInitActivity(activityDef); - InputDispenser inputDispenser = new CoreInputDispenser(activity); - ActionDispenser adisp = new CoreActionDispenser(activity); - OutputDispenser tdisp = CoreServices.getOutputDispenser(activity).orElse(null); - - final MotorDispenser mdisp = new CoreMotorDispenser(activity, inputDispenser, adisp, tdisp); - activity.setActionDispenserDelegate(adisp); - activity.setOutputDispenserDelegate(tdisp); - activity.setInputDispenserDelegate(inputDispenser); - activity.setMotorDispenserDelegate(mdisp); - - final ExecutorService executor = Executors.newCachedThreadPool(); - ActivityExecutor activityExecutor = new ActivityExecutor(activity, "test-restart"); - final Future future = executor.submit(activityExecutor); - try { - activityDef.setThreads(1); - activityExecutor.startActivity(); - Thread.sleep(500L); - activityExecutor.stopActivity(); - activityExecutor.startActivity(); - activityExecutor.stopActivity(); - future.get(); - } catch (Exception e) { - throw new RuntimeException(e); - } - executor.shutdown(); - assertThat(inputDispenser.getInput(10).getInputSegment(3)).isNotNull(); - - } +// TODO: Design review of this mechanism +// @Test +// synchronized void testRestart() { +// ActivityDef activityDef = ActivityDef.parseActivityDef("driver=diag;alias=test-restart;cycles=1000;cyclerate=10;op=initdelay:initdelay=5000;"); +// new ActivityTypeLoader().load(activityDef); +// +// final Activity activity = new DelayedInitActivity(activityDef); +// InputDispenser inputDispenser = new CoreInputDispenser(activity); +// ActionDispenser adisp = new CoreActionDispenser(activity); +// OutputDispenser tdisp = CoreServices.getOutputDispenser(activity).orElse(null); +// +// final MotorDispenser mdisp = new CoreMotorDispenser(activity, inputDispenser, adisp, tdisp); +// activity.setActionDispenserDelegate(adisp); +// activity.setOutputDispenserDelegate(tdisp); +// activity.setInputDispenserDelegate(inputDispenser); +// activity.setMotorDispenserDelegate(mdisp); +// +// final ExecutorService executor = Executors.newCachedThreadPool(); +// ActivityExecutor activityExecutor = new ActivityExecutor(activity, "test-restart"); +// final Future future = executor.submit(activityExecutor); +// try { +// activityDef.setThreads(1); +// activityExecutor.startActivity(); +// Thread.sleep(100L); +// activityExecutor.stopActivity(); +// Thread.sleep(100L); +// activityExecutor.startActivity(); +// Thread.sleep(100L); +// activityExecutor.stopActivity(); +// future.get(); +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// executor.shutdown(); +// assertThat(inputDispenser.getInput(10).getInputSegment(3)).isNotNull(); +// +// } @Test synchronized void testDelayedStartSanity() { From b1620ae4075bd006fc55040a1f60fb5f45ef63cd Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Mon, 6 Feb 2023 15:23:28 -0600 Subject: [PATCH 6/6] update script --- scripts/.delete-tags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/.delete-tags b/scripts/.delete-tags index e4926f0b2..00388894d 100755 --- a/scripts/.delete-tags +++ b/scripts/.delete-tags @@ -9,7 +9,7 @@ printf " - nosqlbench-4.17.20+\n" printf " - nosqlbench-4.15.100+\n" printf " FURTHER: This removes all your local tags first and then synchronizes\n" printf " from origin. If you have any special tags only on local, it will remove them.\n" -printf " If you do NOT want to do this, hit crtl-c now!\n" +printf " If you do NOT want to do this, hit control-c now!\n" read response #delete all the remote tags with the pattern your looking for ...