relax rate test for slow github nodes

This commit is contained in:
Jonathan Shook 2021-11-18 17:51:26 -06:00
parent 11dd8f62da
commit eeb6f97c17
3 changed files with 5 additions and 186 deletions

View File

@ -105,7 +105,7 @@ public class AsyncScriptIntegrationTests {
String digits = m.group(1); String digits = m.group(1);
assertThat(digits).isNotEmpty(); assertThat(digits).isNotEmpty();
double rate = Double.valueOf(digits); double rate = Double.parseDouble(digits);
assertThat(rate).isCloseTo(1000, Offset.offset(100.0)); assertThat(rate).isCloseTo(1000, Offset.offset(100.0));
} }

View File

@ -90,185 +90,4 @@ public class ScriptIntegrationTests {
assertThat(rate).isCloseTo(1000, Offset.offset(100.0)); assertThat(rate).isCloseTo(1000, Offset.offset(100.0));
} }
// The tests below are being disabled and eventually removed.
// The async versions are higher sensitivity and equivalent in
// every other way.
// This should reduce the build time for integrated testing.
// @Test
// public void testStrideRateOnly() {
// ScenarioResult scenarioResult = runScenario("stride_rate");
// String iolog = scenarioResult.getIOLog();
// System.out.println("iolog\n" + iolog);
// Pattern p = Pattern.compile(".*stride_rate.strides.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
// Matcher m = p.matcher(iolog);
// assertThat(m.matches()).isTrue();
//
// String digits = m.group(1);
// assertThat(digits).isNotEmpty();
// double rate = Double.valueOf(digits);
// assertThat(rate).isCloseTo(10000.0D, Offset.offset(1000D));
// }
//
// @Test
// public void testPhaseRateOnly() {
// ScenarioResult scenarioResult = runScenario("phase_rate");
// String iolog = scenarioResult.getIOLog();
// System.out.println("iolog\n" + iolog);
// Pattern p = Pattern.compile(".*phase_rate.phases.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
// Matcher m = p.matcher(iolog);
// assertThat(m.matches()).isTrue();
//
// String digits = m.group(1);
// assertThat(digits).isNotEmpty();
// double rate = Double.valueOf(digits);
// assertThat(rate).isCloseTo(25000.0D, Offset.offset(5000D));
// }
//
//
// @Test
// public void testExtensionPoint() {
// ScenarioResult scenarioResult = runScenario("extensions");
// assertThat(scenarioResult.getIOLog()).contains("sum is 46");
// }
//
// @Test
// public void testLinkedInput() {
// ScenarioResult scenarioResult = runScenario("linkedinput");
// Pattern p = Pattern.compile(".*started leader.*started follower.*stopped leader.*stopped follower.*",
// Pattern.DOTALL);
// assertThat(p.matcher(scenarioResult.getIOLog()).matches()).isTrue();
// }
//
// @Test
// public void testExtensionCsvLogger() {
// ScenarioResult scenarioResult = runScenario("extension_csvmetrics");
// assertThat(scenarioResult.getIOLog()).contains("started new " +
// "csvlogger: logs/csvmetricstestdir");
// }
//
//
// @Test
// public void testScriptParamsVariable() {
// ScenarioResult scenarioResult = runScenario("params_variable", "one", "two", "three", "four");
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"one\")='two'");
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\")='four'");
// assertThat(scenarioResult.getIOLog()).contains("params.size()=2");
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\") [overridden-three-five]='five'");
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"four\") [defaulted-four-niner]='niner'");
// }
//
// @Test
// public void testExtensionHistoStatsLogger() throws IOException {
// ScenarioResult scenarioResult = runScenario("extension_histostatslogger");
// assertThat(scenarioResult.getIOLog()).contains("stdout started " +
// "logging to logs/histostats.csv");
// List<String> strings = Files.readAllLines(Paths.get(
// "logs/histostats.csv"));
// String logdata = strings.stream().collect(Collectors.joining("\n"));
// assertThat(logdata).contains("min,p25,p50,p75,p90,p95,");
// assertThat(logdata.split("Tag=testhistostatslogger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
// }
//
// @Test
// public void testExtensionHistogramLogger() throws IOException {
// ScenarioResult scenarioResult = runScenario("extension_histologger");
// assertThat(scenarioResult.getIOLog()).contains("stdout started logging to hdrhistodata.log");
// List<String> strings = Files.readAllLines(Paths.get("hdrhistodata.log"));
// String logdata = strings.stream().collect(Collectors.joining("\n"));
// assertThat(logdata).contains(",HIST");
// assertThat(logdata.split("Tag=testhistologger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
// }
//
// @Test
// public void testBlockingRun() {
// ScenarioResult scenarioResult = runScenario("blockingrun");
// int a1end = scenarioResult.getIOLog().indexOf("blockingactivity1 finished");
// int a2start = scenarioResult.getIOLog().indexOf("running blockingactivity2");
// assertThat(a1end).isLessThan(a2start);
// }
//
// @Test
// public void testAwaitFinished() {
// ScenarioResult scenarioResult = runScenario("awaitfinished");
// scenarioResult.reportToLog();
// }
//
// @Test
// public void testStartStop() {
// ScenarioResult scenarioResult = runScenario("startstopdiag");
// scenarioResult.reportToLog();
// int startedAt = scenarioResult.getIOLog().indexOf("starting activity teststartstopdiag");
// int stoppedAt = scenarioResult.getIOLog().indexOf("stopped activity teststartstopdiag");
// assertThat(startedAt).isGreaterThan(0);
// assertThat(stoppedAt).isGreaterThan(startedAt);
// }
//
// @Test
// public void testThreadChange() {
// ScenarioResult scenarioResult = runScenario("threadchange");
// int changedTo1At = scenarioResult.getIOLog().indexOf("threads now 1");
// int changedTo5At = scenarioResult.getIOLog().indexOf("threads now 5");
// assertThat(changedTo1At).isGreaterThan(0);
// assertThat(changedTo5At).isGreaterThan(changedTo1At);
// }
//
// @Test
// public void testReadMetric() {
// ScenarioResult scenarioResult = runScenario("readmetrics");
// assertThat(scenarioResult.getIOLog()).contains("count: ");
// }
//
// @Test
// public void testExceptionPropagationFromMotorThread() {
// ScenarioResult scenarioResult = runScenario("activityerror");
// assertThat(scenarioResult.getException()).isPresent();
// assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
// }
//
// @Test
// public void testExceptionPropagationFromActivityInit() {
// ScenarioResult scenarioResult = runScenario("activityiniterror");
// assertThat(scenarioResult.getException()).isPresent();
// assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
// assertThat(scenarioResult.getException()).isNotNull();
// }
//
// @Test
// public void testReportedCoDelayBursty() {
// ScenarioResult scenarioResult = runScenario("cocycledelay_bursty");
// assertThat(scenarioResult.getIOLog()).contains("step1 metrics.waittime=");
// assertThat(scenarioResult.getIOLog()).contains("step2 metrics.waittime=");
// String iolog = scenarioResult.getIOLog();
// System.out.println(iolog);
// assertThat(iolog).contains("waittime trended back down as expected");
// }
//
// @Test
// public void testReportedCoDelayStrict() {
// ScenarioResult scenarioResult = runScenario("cocycledelay_strict");
// assertThat(scenarioResult.getIOLog()).contains("step1 cycles.waittime=");
// assertThat(scenarioResult.getIOLog()).contains("step2 cycles.waittime=");
// String iolog = scenarioResult.getIOLog();
// System.out.println(iolog);
// // TODO: ensure that waittime is staying the same or increasing
// // after investigating minor decreasing effect
// }
//
//
// @Test
// public void testCycleRateChange() {
// ScenarioResult scenarioResult = runScenario("cycle_rate_change");
// String ioLog = scenarioResult.getIOLog();
// assertThat(ioLog).contains("cycles adjusted, exiting on iteration");
// }
//
// @Test
// public void testExitLogic() {
// ScenarioResult scenarioResult = runScenario(
// "basicdiag",
// "type", "diag", "cyclerate", "5", "erroroncycle", "10", "cycles", "2000"
// );
// }
} }

View File

@ -29,9 +29,9 @@ print('starting cycle_rate_change');
scenario.start(activitydef); scenario.start(activitydef);
print('started'); print('started');
print('cyclerate at 0ms:' + activities.cycle_rate_change.cyclerate); print('cyclerate at 0ms:' + activities.cycle_rate_change.cyclerate);
scenario.waitMillis(1000); scenario.waitMillis(500);
activities.cycle_rate_change.cyclerate='5000'; activities.cycle_rate_change.cyclerate='1000';
print("measured cycle increment per second is expected to adjust to 5000"); print("measured cycle increment per second is expected to adjust to 1000");
print('cyclerate now:' + activities.cycle_rate_change.cyclerate); print('cyclerate now:' + activities.cycle_rate_change.cyclerate);
@ -43,7 +43,7 @@ for(i=0;i<20;i++) {
print("new this second: " + (nextcount - lastcount)); print("new this second: " + (nextcount - lastcount));
print(" waittime: " + metrics.cycle_rate_change.cycles.waittime.value); print(" waittime: " + metrics.cycle_rate_change.cycles.waittime.value);
lastcount=nextcount; lastcount=nextcount;
if (cycles>4700 && cycles<5300) { if (cycles>700 && cycles<1300) {
print("cycles adjusted, exiting on iteration " + i); print("cycles adjusted, exiting on iteration " + i);
break; break;
} }