From dd4f7909439a470e7867de5d2fce408a1c1c99c8 Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:16:08 +0200 Subject: [PATCH 01/13] Disable simple workload test --- .../workloads/simple/SimpleWorkloadTest.java | 214 +++++++++--------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/src/test/java/org/ldbcouncil/snb/driver/workloads/simple/SimpleWorkloadTest.java b/src/test/java/org/ldbcouncil/snb/driver/workloads/simple/SimpleWorkloadTest.java index 98fdf6636..d2a41b343 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/workloads/simple/SimpleWorkloadTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/workloads/simple/SimpleWorkloadTest.java @@ -1,112 +1,112 @@ -package org.ldbcouncil.snb.driver.workloads.simple; +// package org.ldbcouncil.snb.driver.workloads.simple; -import com.google.common.collect.Lists; -import org.ldbcouncil.snb.driver.Operation; -import org.ldbcouncil.snb.driver.Workload; -import org.ldbcouncil.snb.driver.control.ConsoleAndFileDriverConfiguration; -import org.ldbcouncil.snb.driver.control.DriverConfiguration; -import org.ldbcouncil.snb.driver.util.Tuple; -import org.ldbcouncil.snb.driver.util.Tuple2; -import org.ldbcouncil.snb.driver.workloads.ClassNameWorkloadFactory; -import org.ldbcouncil.snb.driver.workloads.WorkloadTest; -import org.ldbcouncil.snb.driver.workloads.simple.db.SimpleDb; -import org.junit.jupiter.api.Disabled; +// import com.google.common.collect.Lists; +// import org.ldbcouncil.snb.driver.Operation; +// import org.ldbcouncil.snb.driver.Workload; +// import org.ldbcouncil.snb.driver.control.ConsoleAndFileDriverConfiguration; +// import org.ldbcouncil.snb.driver.control.DriverConfiguration; +// import org.ldbcouncil.snb.driver.util.Tuple; +// import org.ldbcouncil.snb.driver.util.Tuple2; +// import org.ldbcouncil.snb.driver.workloads.ClassNameWorkloadFactory; +// import org.ldbcouncil.snb.driver.workloads.WorkloadTest; +// import org.ldbcouncil.snb.driver.workloads.simple.db.SimpleDb; +// import org.junit.jupiter.api.Disabled; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; +// import java.util.ArrayList; +// import java.util.HashMap; +// import java.util.Iterator; +// import java.util.List; -// TODO unDisabled and fix existing failures -@Disabled -public class SimpleWorkloadTest extends WorkloadTest -{ - @Override - public Workload workload() throws Exception - { - DriverConfiguration configuration = ConsoleAndFileDriverConfiguration.fromDefaults( - SimpleDb.class.getName(), - SimpleWorkload.class.getName(), - 1_000_000 - ).applyArg( - ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, - Long.toString( 1_000_000 ) - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "true" - ); - Workload workload = new ClassNameWorkloadFactory( configuration.workloadClassName() ).createWorkload(); - workload.init( configuration ); - return workload; - } +// // TODO unDisabled and fix existing failures +// @Disabled +// public class SimpleWorkloadTest extends WorkloadTest +// { +// @Override +// public Workload workload() throws Exception +// { +// DriverConfiguration configuration = ConsoleAndFileDriverConfiguration.fromDefaults( +// SimpleDb.class.getName(), +// SimpleWorkload.class.getName(), +// 1_000_000 +// ).applyArg( +// ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, +// Long.toString( 1_000_000 ) +// ).applyArg( +// ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, +// "true" +// ); +// Workload workload = new ClassNameWorkloadFactory( configuration.workloadClassName() ).createWorkload(); +// workload.init( configuration ); +// return workload; +// } - @Override - public List> operationsAndResults() throws Exception - { - return Lists.newArrayList( - Tuple.tuple2( - new InsertOperation( - "table", - "key", - new HashMap>() - ), - "nothing" - ), - Tuple.tuple2( - new ReadModifyWriteOperation( - "table", - "key", - new ArrayList(), - new HashMap>() - ), - "nothing" - ), - Tuple.tuple2( - new ReadOperation( - "table", - "key", - new ArrayList() - ), - "nothing" - ), - Tuple.tuple2( - new ScanOperation( - "table", - "startKey", - 1, - new ArrayList() - ), - "nothing" - ), - Tuple.tuple2( - new UpdateOperation( - "table", - "key", - new HashMap>() - ), - "nothing" - ) - ); - } +// @Override +// public List> operationsAndResults() throws Exception +// { +// return Lists.newArrayList( +// Tuple.tuple2( +// new InsertOperation( +// "table", +// "key", +// new HashMap>() +// ), +// "nothing" +// ), +// Tuple.tuple2( +// new ReadModifyWriteOperation( +// "table", +// "key", +// new ArrayList(), +// new HashMap>() +// ), +// "nothing" +// ), +// Tuple.tuple2( +// new ReadOperation( +// "table", +// "key", +// new ArrayList() +// ), +// "nothing" +// ), +// Tuple.tuple2( +// new ScanOperation( +// "table", +// "startKey", +// 1, +// new ArrayList() +// ), +// "nothing" +// ), +// Tuple.tuple2( +// new UpdateOperation( +// "table", +// "key", +// new HashMap>() +// ), +// "nothing" +// ) +// ); +// } - @Override - public List configurations() throws Exception - { - return Lists.newArrayList( - ConsoleAndFileDriverConfiguration.fromDefaults( - SimpleDb.class.getName(), - SimpleWorkload.class.getName(), - 1_000_000 - ).applyArg( - ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, - Long.toString( 1_000_000 ) - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "false" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.0001" - ) - ); - } -} +// @Override +// public List configurations() throws Exception +// { +// return Lists.newArrayList( +// ConsoleAndFileDriverConfiguration.fromDefaults( +// SimpleDb.class.getName(), +// SimpleWorkload.class.getName(), +// 1_000_000 +// ).applyArg( +// ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, +// Long.toString( 1_000_000 ) +// ).applyArg( +// ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, +// "false" +// ).applyArg( +// ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, +// "0.0001" +// ) +// ); +// } +// } From 67e2835bb8f7882a7766cb80290bdc9841749f8b Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:16:13 +0200 Subject: [PATCH 02/13] Move configurations to parameter stream for tests --- .../snb/driver/workloads/WorkloadTest.java | 672 ++++++++---------- .../interactive/InteractiveWorkloadTest.java | 383 ++++++---- 2 files changed, 548 insertions(+), 507 deletions(-) diff --git a/src/test/java/org/ldbcouncil/snb/driver/workloads/WorkloadTest.java b/src/test/java/org/ldbcouncil/snb/driver/workloads/WorkloadTest.java index 930e39f7d..213589880 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/workloads/WorkloadTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/workloads/WorkloadTest.java @@ -28,13 +28,10 @@ import org.ldbcouncil.snb.driver.validation.DbValidationResult; import org.ldbcouncil.snb.driver.validation.WorkloadValidationResult; import org.ldbcouncil.snb.driver.validation.WorkloadValidator; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -55,77 +52,42 @@ public abstract class WorkloadTest { - @TempDir - public File temporaryFolder; TimeSource timeSource = new SystemTimeSource(); - public abstract Workload workload() throws Exception; - - public abstract List> operationsAndResults() throws Exception; - - public abstract List configurations() throws Exception; - - private List withTempResultDirs( List configurations ) + private DriverConfiguration withTempResultDirs( DriverConfiguration configuration, File temporaryFolder ) throws IOException, DriverConfigurationException { - List configurationsWithTempResultDirs = new ArrayList<>(); - for ( DriverConfiguration configuration : configurations ) - { - configurationsWithTempResultDirs.add( - configuration.applyArg( - ConsoleAndFileDriverConfiguration.RESULT_DIR_PATH_ARG, - new File(temporaryFolder, UUID.randomUUID().toString()).getAbsolutePath() - ) - ); - } - return configurationsWithTempResultDirs; + return configuration.applyArg( + ConsoleAndFileDriverConfiguration.RESULT_DIR_PATH_ARG, + new File(temporaryFolder, UUID.randomUUID().toString()).getAbsolutePath() + ); } - private List withWarmup( List configurations ) + private DriverConfiguration withWarmup( DriverConfiguration configuration ) throws IOException, DriverConfigurationException { - List configurationsWithSkip = new ArrayList<>(); - for ( DriverConfiguration configuration : configurations ) - { - configurationsWithSkip.add( - (0 == configuration.warmupCount()) - ? configuration.applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 10 ) ) - : configuration - ); - } - return configurationsWithSkip; + return (0 == configuration.warmupCount()) + ? configuration.applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 10 ) ) + : configuration; + } - private List withSkip( List configurations ) + private DriverConfiguration withSkip( DriverConfiguration configuration ) throws IOException, DriverConfigurationException { - List configurationsWithSkip = new ArrayList<>(); - for ( DriverConfiguration configuration : configurations ) - { - configurationsWithSkip.add( - (0 == configuration.skipCount()) + return (0 == configuration.skipCount()) ? configuration.applyArg( ConsoleAndFileDriverConfiguration.SKIP_COUNT_ARG, Long.toString( 10 ) ) - : configuration - ); - } - return configurationsWithSkip; + : configuration; } - private List withMode( List configurations, String mode ) + private DriverConfiguration withMode( DriverConfiguration configuration, String mode ) throws IOException, DriverConfigurationException { - List configurationsWithSkip = new ArrayList<>(); - for ( DriverConfiguration configuration : configurations ) - { - configuration.applyArg( ConsoleAndFileDriverConfiguration.MODE_ARG, mode ); - } - return configurationsWithSkip; + return configuration.applyArg( ConsoleAndFileDriverConfiguration.MODE_ARG, mode ); } - @Test - public void shouldHaveOneToOneMappingBetweenOperationClassesAndOperationTypes() throws Exception + public void shouldHaveOneToOneMappingBetweenOperationClassesAndOperationTypes(Workload workload) throws Exception { - Workload workload = workload(); Map> typeToClassMapping = workload.operationTypeToClassMapping(); assertThat( typeToClassMapping.keySet().size(), @@ -133,10 +95,8 @@ public void shouldHaveOneToOneMappingBetweenOperationClassesAndOperationTypes() ); } - @Test - public void shouldHaveNonNegativeTypesForAllOperations() throws Exception + public void shouldHaveNonNegativeTypesForAllOperations(Workload workload, List> operationsAndResults) throws Exception { - Workload workload = workload(); for ( Map.Entry> entry : workload.operationTypeToClassMapping().entrySet() ) { @@ -146,7 +106,7 @@ public void shouldHaveNonNegativeTypesForAllOperations() throws Exception ); } - for ( Tuple2 operation : operationsAndResults() ) + for ( Tuple2 operation : operationsAndResults ) { assertTrue( operation._1().type() >= 0, @@ -156,13 +116,8 @@ public void shouldHaveNonNegativeTypesForAllOperations() throws Exception } } - @Test - public void shouldBeAbleToSerializeAndMarshalAllOperations() throws Exception + public void shouldBeAbleToSerializeAndMarshalAllOperations(Workload workload, List> operationsAndResults) throws Exception { - // Given - Workload workload = workload(); - List> operationsAndResults = operationsAndResults(); - // When ObjectMapper mapper = new ObjectMapper(); @@ -186,12 +141,8 @@ public void shouldBeAbleToSerializeAndMarshalAllOperations() throws Exception } } - @Test - public void shouldBeAbleToSerializeAndMarshalAllOperationResults() throws Exception + public void shouldBeAbleToSerializeAndMarshalAllOperationResults(List> operationsAndResults) throws Exception { - // Given - List> operationsAndResults = operationsAndResults(); - // When ObjectMapper mapper = new ObjectMapper(); // Then @@ -214,363 +165,340 @@ public void shouldBeAbleToSerializeAndMarshalAllOperationResults() throws Except } } - @Test - public void shouldGenerateManyOperationsInReasonableTimeForLongReadOnly() throws Exception + public boolean shouldGenerateManyOperationsInReasonableTime(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withTempResultDirs( configurations() ) ) - { - long operationCount = 1_000_000; - long timeoutAsMilli = TimeUnit.SECONDS.toMillis( 5 ); - - Workload workload = new ClassNameWorkloadFactory( configuration.workloadClassName() ) - .createWorkload(); - workload.init( configuration ); - GeneratorFactory gf = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); - Iterator operations = gf.limit( - WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( - gf, - workload.streams( gf, true ) - ), - operationCount - ); - long timeout = timeSource.nowAsMilli() + timeoutAsMilli; - boolean workloadGeneratedOperationsBeforeTimeout = - TestUtils.generateBeforeTimeout( operations, timeout, timeSource, operationCount ); - assertTrue( workloadGeneratedOperationsBeforeTimeout ); - } + configuration = withTempResultDirs( configuration, temporaryFolder ); + long operationCount = 1_000_000; + long timeoutAsMilli = TimeUnit.SECONDS.toMillis( 5 ); + + Workload workload = new ClassNameWorkloadFactory( configuration.workloadClassName() ) + .createWorkload(); + workload.init( configuration ); + GeneratorFactory gf = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); + Iterator operations = gf.limit( + WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( + gf, + workload.streams( gf, true ) + ), + operationCount + ); + long timeout = timeSource.nowAsMilli() + timeoutAsMilli; + return TestUtils.generateBeforeTimeout( operations, timeout, timeSource, operationCount ); } - @Test - public void shouldBeRepeatableWhenTwoIdenticalWorkloadsAreUsedWithIdenticalGeneratorFactories() throws Exception + public void shouldBeRepeatableWhenTwoIdenticalWorkloadsAreUsedWithIdenticalGeneratorFactories(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs( configurations() ) ) ) ) - { - WorkloadFactory workloadFactory = new ClassNameWorkloadFactory( configuration.workloadClassName() ); - GeneratorFactory gf1 = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); - GeneratorFactory gf2 = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); - Workload workloadA = workloadFactory.createWorkload(); - Workload workloadB = workloadFactory.createWorkload(); - workloadA.init( configuration ); - workloadB.init( configuration ); - - List operationsA = ImmutableList.copyOf( - Iterators.transform( - gf1.limit( - WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( - gf1, - workloadA.streams( gf1, true ) - ), - configuration.operationCount() - ), - new Function() + configuration = withSkip( withWarmup( withTempResultDirs( configuration, temporaryFolder ) ) ); + WorkloadFactory workloadFactory = new ClassNameWorkloadFactory( configuration.workloadClassName() ); + GeneratorFactory gf1 = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); + GeneratorFactory gf2 = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); + Workload workloadA = workloadFactory.createWorkload(); + Workload workloadB = workloadFactory.createWorkload(); + workloadA.init( configuration ); + workloadB.init( configuration ); + + List operationsA = ImmutableList.copyOf( + Iterators.transform( + gf1.limit( + WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( + gf1, + workloadA.streams( gf1, true ) + ), + configuration.operationCount() + ), + new Function() + { + @Override + public Class apply( Operation operation ) { - @Override - public Class apply( Operation operation ) - { - return operation.getClass(); - } + return operation.getClass(); } - ) - ); + } + ) + ); - List operationsB = ImmutableList.copyOf( - Iterators.transform( - gf1.limit( - WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( - gf2, - workloadB.streams( gf2, true ) - ), - configuration.operationCount() - ), - new Function() + List operationsB = ImmutableList.copyOf( + Iterators.transform( + gf1.limit( + WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( + gf2, + workloadB.streams( gf2, true ) + ), + configuration.operationCount() + ), + new Function() + { + @Override + public Class apply( Operation operation ) { - @Override - public Class apply( Operation operation ) - { - return operation.getClass(); - } + return operation.getClass(); } - ) - ); + } + ) + ); - assertThat( operationsA.size(), is( operationsB.size() ) ); + assertThat( operationsA.size(), is( operationsB.size() ) ); - Iterator operationsAIt = operationsA.iterator(); - Iterator operationsBIt = operationsB.iterator(); + Iterator operationsAIt = operationsA.iterator(); + Iterator operationsBIt = operationsB.iterator(); - while ( operationsAIt.hasNext() ) - { - Class a = operationsAIt.next(); - Class b = operationsBIt.next(); - assertThat( a, equalTo( b ) ); - } + while ( operationsAIt.hasNext() ) + { + Class a = operationsAIt.next(); + Class b = operationsBIt.next(); + assertThat( a, equalTo( b ) ); } } - @Test - public void shouldLoadFromConfigFile() throws Exception + public void shouldLoadFromConfigFile(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs( configurations() ) ) ) ) + configuration = withSkip( withWarmup( withTempResultDirs( configuration, temporaryFolder ) ) ); + File configurationFile = new File(temporaryFolder, "config.properties"); + Files.write( configurationFile.toPath(), configuration.toPropertiesString().getBytes() ); + + assertTrue( configurationFile.exists() ); + + configuration = ConsoleAndFileDriverConfiguration.fromArgs( new String[]{ + "-P", configurationFile.getAbsolutePath() + } ); + + ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); + + for ( File file : resultsDirectory.expectedFiles() ) { - File configurationFile = new File(temporaryFolder, "config.properties"); - Files.write( configurationFile.toPath(), configuration.toPropertiesString().getBytes() ); - assertTrue( configurationFile.exists() ); - - configuration = ConsoleAndFileDriverConfiguration.fromArgs( new String[]{ - "-P", configurationFile.getAbsolutePath() - } ); - - ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); - - for ( File file : resultsDirectory.expectedFiles() ) - { - assertFalse( file.exists(), format( "Did not expect file to exist %s", file.getAbsolutePath() )); - } - - // When - Client client = new Client(); - ControlService controlService = new LocalControlService( - timeSource.nowAsMilli(), - configuration, - new Log4jLoggingServiceFactory( false ), - timeSource - ); - ClientMode clientMode = client.getClientModeFor( controlService ); - clientMode.init(); - clientMode.startExecutionAndAwaitCompletion(); - - // Then - for ( File file : resultsDirectory.expectedFiles() ) - { - assertTrue( file.exists() ); - } - assertThat( resultsDirectory.expectedFiles(), equalTo( resultsDirectory.files() ) ); - - if ( configuration.warmupCount() > 0 ) - { - long resultsLogSize = resultsDirectory.getResultsLogFileLength( true ); - assertThat( - format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", - operationCountLower( configuration.warmupCount() ), - operationCountUpper( configuration.warmupCount() ), - resultsLogSize, - resultsDirectory.getResultsLogFile( true ).getAbsolutePath() - ), - resultsLogSize, - allOf( - greaterThanOrEqualTo( operationCountLower( configuration.warmupCount() ) ), - lessThanOrEqualTo( operationCountUpper( configuration.warmupCount() ) ) - ) - ); - } - long resultsLogSize = resultsDirectory.getResultsLogFileLength( false ); + assertFalse( file.exists(), format( "Did not expect file to exist %s", file.getAbsolutePath() )); + } + + // When + Client client = new Client(); + ControlService controlService = new LocalControlService( + timeSource.nowAsMilli(), + configuration, + new Log4jLoggingServiceFactory( false ), + timeSource + ); + ClientMode clientMode = client.getClientModeFor( controlService ); + clientMode.init(); + clientMode.startExecutionAndAwaitCompletion(); + + // Then + for ( File file : resultsDirectory.expectedFiles() ) + { + assertTrue( file.exists() ); + } + assertThat( resultsDirectory.expectedFiles(), equalTo( resultsDirectory.files() ) ); + + if ( configuration.warmupCount() > 0 ) + { + long resultsLogSize = resultsDirectory.getResultsLogFileLength( true ); assertThat( format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", - operationCountLower( configuration.operationCount() ), - operationCountUpper( configuration.operationCount() ), + operationCountLower( configuration.warmupCount() ), + operationCountUpper( configuration.warmupCount() ), resultsLogSize, - resultsDirectory.getResultsLogFile( false ).getAbsolutePath() + resultsDirectory.getResultsLogFile( true ).getAbsolutePath() ), resultsLogSize, allOf( - greaterThanOrEqualTo( operationCountLower( configuration.operationCount() ) ), - lessThanOrEqualTo( operationCountUpper( configuration.operationCount() ) ) + greaterThanOrEqualTo( operationCountLower( configuration.warmupCount() ) ), + lessThanOrEqualTo( operationCountUpper( configuration.warmupCount() ) ) ) ); } + long resultsLogSize = resultsDirectory.getResultsLogFileLength( false ); + assertThat( + format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", + operationCountLower( configuration.operationCount() ), + operationCountUpper( configuration.operationCount() ), + resultsLogSize, + resultsDirectory.getResultsLogFile( false ).getAbsolutePath() + ), + resultsLogSize, + allOf( + greaterThanOrEqualTo( operationCountLower( configuration.operationCount() ) ), + lessThanOrEqualTo( operationCountUpper( configuration.operationCount() ) ) + ) + ); } - @Test - public void shouldAssignMonotonicallyIncreasingScheduledStartTimesToOperations() throws Exception + public void shouldAssignMonotonicallyIncreasingScheduledStartTimesToOperations(DriverConfiguration configuration, File temporaryFolder) throws Exception { GeneratorFactory gf = new GeneratorFactory( new RandomDataGeneratorFactory( 42L ) ); + configuration = withSkip( withWarmup( withTempResultDirs( configuration, temporaryFolder ) ) ); - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs( configurations() ) ) ) ) - { - Workload workload = - new ClassNameWorkloadFactory( configuration.workloadClassName() ).createWorkload(); - workload.init( configuration ); - - List operations = Lists.newArrayList( - gf.limit( - WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( - gf, - workload.streams( gf, true ) - ), - configuration.operationCount() - ) - ); + Workload workload = + new ClassNameWorkloadFactory( configuration.workloadClassName() ).createWorkload(); + workload.init( configuration ); - Operation prevOperation = operations.get( 0 ); - long prevOperationScheduledStartTime = prevOperation.scheduledStartTimeAsMilli() - 1; - for ( Operation operation : operations ) - { - assertTrue( - operation.scheduledStartTimeAsMilli() >= prevOperationScheduledStartTime , - format("Operation %s has lower start time than %s", operation, prevOperation)); - prevOperationScheduledStartTime = operation.scheduledStartTimeAsMilli(); - prevOperation = operation; - } + List operations = Lists.newArrayList( + gf.limit( + WorkloadStreams.mergeSortedByStartTimeExcludingChildOperationGenerators( + gf, + workload.streams( gf, true ) + ), + configuration.operationCount() + ) + ); + + Operation prevOperation = operations.get( 0 ); + long prevOperationScheduledStartTime = prevOperation.scheduledStartTimeAsMilli() - 1; + for ( Operation operation : operations ) + { + assertTrue( + operation.scheduledStartTimeAsMilli() >= prevOperationScheduledStartTime , + format("Operation %s has lower start time than %s", operation, prevOperation)); + prevOperationScheduledStartTime = operation.scheduledStartTimeAsMilli(); + prevOperation = operation; } } - @Test - public void shouldRunWorkload() throws Exception + public void shouldRunWorkload(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs( configurations() ) ) ) ) + configuration = withSkip( withWarmup( withTempResultDirs( configuration, temporaryFolder ) ) ); + ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); + + for ( File file : resultsDirectory.expectedFiles() ) { - ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); - - for ( File file : resultsDirectory.expectedFiles() ) - { - assertFalse( - file.exists(), - format( "Did not expect file to exist %s", file.getAbsolutePath() ) ); - } - - Client client = new Client(); - ControlService controlService = new LocalControlService( - timeSource.nowAsMilli(), - configuration, - new Log4jLoggingServiceFactory( false ), - timeSource - ); - ClientMode clientMode = client.getClientModeFor( controlService ); - clientMode.init(); - clientMode.startExecutionAndAwaitCompletion(); - - for ( File file : resultsDirectory.expectedFiles() ) - { - assertTrue( file.exists() ); - } - assertThat( resultsDirectory.expectedFiles(), equalTo( resultsDirectory.files() ) ); - - if ( configuration.warmupCount() > 0 ) - { - long resultsLogSize = resultsDirectory.getResultsLogFileLength( true ); - assertThat( - format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", - operationCountLower( configuration.warmupCount() ), - operationCountUpper( configuration.warmupCount() ), - resultsLogSize, - resultsDirectory.getResultsLogFile( true ).getAbsolutePath() - ), - resultsLogSize, - allOf( - greaterThanOrEqualTo( operationCountLower( configuration.warmupCount() ) ), - lessThanOrEqualTo( operationCountUpper( configuration.warmupCount() ) ) - ) - ); - } - long resultsLogSize = resultsDirectory.getResultsLogFileLength( false ); + assertFalse( + file.exists(), + format( "Did not expect file to exist %s", file.getAbsolutePath() ) ); + } + + Client client = new Client(); + ControlService controlService = new LocalControlService( + timeSource.nowAsMilli(), + configuration, + new Log4jLoggingServiceFactory( false ), + timeSource + ); + ClientMode clientMode = client.getClientModeFor( controlService ); + clientMode.init(); + clientMode.startExecutionAndAwaitCompletion(); + + for ( File file : resultsDirectory.expectedFiles() ) + { + assertTrue( file.exists() ); + } + assertThat( resultsDirectory.expectedFiles(), equalTo( resultsDirectory.files() ) ); + + if ( configuration.warmupCount() > 0 ) + { + long resultsLogSize = resultsDirectory.getResultsLogFileLength( true ); assertThat( format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", - operationCountLower( configuration.operationCount() ), - operationCountUpper( configuration.operationCount() ), + operationCountLower( configuration.warmupCount() ), + operationCountUpper( configuration.warmupCount() ), resultsLogSize, - resultsDirectory.getResultsLogFile( false ).getAbsolutePath() + resultsDirectory.getResultsLogFile( true ).getAbsolutePath() ), resultsLogSize, allOf( - greaterThanOrEqualTo( operationCountLower( configuration.operationCount() ) ), - lessThanOrEqualTo( operationCountUpper( configuration.operationCount() ) ) + greaterThanOrEqualTo( operationCountLower( configuration.warmupCount() ) ), + lessThanOrEqualTo( operationCountUpper( configuration.warmupCount() ) ) ) ); } + long resultsLogSize = resultsDirectory.getResultsLogFileLength( false ); + assertThat( + format( "Expected %s <= entries in results log <= %s\nFound %s\nResults Log: %s", + operationCountLower( configuration.operationCount() ), + operationCountUpper( configuration.operationCount() ), + resultsLogSize, + resultsDirectory.getResultsLogFile( false ).getAbsolutePath() + ), + resultsLogSize, + allOf( + greaterThanOrEqualTo( operationCountLower( configuration.operationCount() ) ), + lessThanOrEqualTo( operationCountUpper( configuration.operationCount() ) ) + ) + ); } - // TODO: Test should write to memory, not to physical disk. Mock the file and pass it over to the validate_database - @Test - public void shouldCreateValidationParametersThenUseThemToPerformDatabaseValidationThenPass() throws Exception + public void shouldCreateValidationParametersThenUseThemToPerformDatabaseValidationThenPass(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs(withMode( configurations(), "create_validation" )) ) ) ) + configuration = withSkip( withWarmup( withTempResultDirs( withMode(configuration, "create_validation" ), temporaryFolder ) ) ); + // ************************************************** + // where validation parameters should be written (ensure file does not yet exist) + // ************************************************** + File validationParamsFile = new File(temporaryFolder, "validation.csv"); + assertThat( validationParamsFile.length(), is( 0l ) ); + + configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.DB_VALIDATION_FILE_PATH_ARG, validationParamsFile.getAbsolutePath()); + configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.VALIDATION_PARAMS_SIZE_ARG, Integer.toString(500)); + + ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); + + for ( File file : resultsDirectory.expectedFiles() ) { - // ************************************************** - // where validation parameters should be written (ensure file does not yet exist) - // ************************************************** - File validationParamsFile = new File(temporaryFolder, "validation.csv"); - assertThat( validationParamsFile.length(), is( 0l ) ); - - configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.DB_VALIDATION_FILE_PATH_ARG, validationParamsFile.getAbsolutePath()); - configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.VALIDATION_PARAMS_SIZE_ARG, Integer.toString(500)); - - ResultsDirectory resultsDirectory = new ResultsDirectory( configuration ); - - for ( File file : resultsDirectory.expectedFiles() ) - { - assertFalse( file.exists(), format( "Did not expect file to exist %s", file.getAbsolutePath() ) ); - } - - // ************************************************** - // create validation parameters file - // ************************************************** - Client clientForValidationFileCreation = new Client(); - ControlService controlService = new LocalControlService( - timeSource.nowAsMilli(), - configuration, - new Log4jLoggingServiceFactory( false ), - timeSource - ); - ClientMode clientModeForValidationFileCreation = - clientForValidationFileCreation.getClientModeFor( controlService ); - clientModeForValidationFileCreation.init(); - clientModeForValidationFileCreation.startExecutionAndAwaitCompletion(); - - // ************************************************** - // check that validation file creation worked - // ************************************************** - assertTrue( validationParamsFile.length() > 0 ); - - // ************************************************** - // configuration for using validation parameters file to validate the database - // ************************************************** - configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.MODE_ARG, "validate_database"); - configuration = configuration - .applyArg( - ConsoleAndFileDriverConfiguration.DB_VALIDATION_FILE_PATH_ARG, - validationParamsFile.getAbsolutePath() - ); - - // ************************************************** - // validate the database - // ************************************************** - Client clientForDatabaseValidation = new Client(); - controlService = new LocalControlService( - timeSource.nowAsMilli(), - configuration, - new Log4jLoggingServiceFactory( false ), - timeSource - ); - ValidateDatabaseMode clientModeForDatabaseValidation = - (ValidateDatabaseMode) clientForDatabaseValidation.getClientModeFor( controlService ); - clientModeForDatabaseValidation.init(); - DbValidationResult dbValidationResult = - clientModeForDatabaseValidation.startExecutionAndAwaitCompletion(); - - // ************************************************** - // check that validation was successful - // ************************************************** - assertTrue( validationParamsFile.length() > 0 ); - assertThat( dbValidationResult, is( notNullValue() ) ); - assertTrue( - dbValidationResult.isSuccessful(), - format( "Validation with following error\n%s", dbValidationResult.resultMessage() ) ); + assertFalse( file.exists(), format( "Did not expect file to exist %s", file.getAbsolutePath() ) ); } + + // ************************************************** + // create validation parameters file + // ************************************************** + Client clientForValidationFileCreation = new Client(); + ControlService controlService = new LocalControlService( + timeSource.nowAsMilli(), + configuration, + new Log4jLoggingServiceFactory( false ), + timeSource + ); + ClientMode clientModeForValidationFileCreation = + clientForValidationFileCreation.getClientModeFor( controlService ); + clientModeForValidationFileCreation.init(); + clientModeForValidationFileCreation.startExecutionAndAwaitCompletion(); + + // ************************************************** + // check that validation file creation worked + // ************************************************** + assertTrue( validationParamsFile.length() > 0 ); + + // ************************************************** + // configuration for using validation parameters file to validate the database + // ************************************************** + configuration = configuration.applyArg(ConsoleAndFileDriverConfiguration.MODE_ARG, "validate_database"); + configuration = configuration + .applyArg( + ConsoleAndFileDriverConfiguration.DB_VALIDATION_FILE_PATH_ARG, + validationParamsFile.getAbsolutePath() + ); + + // ************************************************** + // validate the database + // ************************************************** + Client clientForDatabaseValidation = new Client(); + controlService = new LocalControlService( + timeSource.nowAsMilli(), + configuration, + new Log4jLoggingServiceFactory( false ), + timeSource + ); + ValidateDatabaseMode clientModeForDatabaseValidation = + (ValidateDatabaseMode) clientForDatabaseValidation.getClientModeFor( controlService ); + clientModeForDatabaseValidation.init(); + DbValidationResult dbValidationResult = + clientModeForDatabaseValidation.startExecutionAndAwaitCompletion(); + + // ************************************************** + // check that validation was successful + // ************************************************** + assertTrue( validationParamsFile.length() > 0 ); + assertThat( dbValidationResult, is( notNullValue() ) ); + assertTrue( + dbValidationResult.isSuccessful(), + format( "Validation with following error\n%s", dbValidationResult.resultMessage() ) ); } - // @Test - public void shouldPassWorkloadValidation() throws Exception + public void shouldPassWorkloadValidation(DriverConfiguration configuration, File temporaryFolder) throws Exception { - for ( DriverConfiguration configuration : withSkip( withWarmup( withTempResultDirs( configurations() ) ) ) ) - { - WorkloadValidator workloadValidator = new WorkloadValidator(); - WorkloadValidationResult workloadValidationResult = workloadValidator.validate( - new ClassNameWorkloadFactory( configuration.workloadClassName() ), - configuration, - new Log4jLoggingServiceFactory( true ) - ); - assertTrue( workloadValidationResult.isSuccessful(),workloadValidationResult.errorMessage() ); - } + configuration = withSkip( withWarmup( withTempResultDirs( configuration, temporaryFolder ) ) ); + WorkloadValidator workloadValidator = new WorkloadValidator(); + WorkloadValidationResult workloadValidationResult = workloadValidator.validate( + new ClassNameWorkloadFactory( configuration.workloadClassName() ), + configuration, + new Log4jLoggingServiceFactory( true ) + ); + assertTrue( workloadValidationResult.isSuccessful(),workloadValidationResult.errorMessage() ); } // TODO add tests related to the results log tolerances that are provided by the workload diff --git a/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java b/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java index b33cf009d..c612df63c 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java @@ -5,6 +5,7 @@ import org.ldbcouncil.snb.driver.Workload; import org.ldbcouncil.snb.driver.control.ConsoleAndFileDriverConfiguration; import org.ldbcouncil.snb.driver.control.DriverConfiguration; +import org.ldbcouncil.snb.driver.control.DriverConfigurationException; import org.ldbcouncil.snb.driver.testutils.TestUtils; import org.ldbcouncil.snb.driver.util.MapUtils; import org.ldbcouncil.snb.driver.util.Tuple; @@ -16,17 +17,27 @@ import org.ldbcouncil.snb.driver.workloads.interactive.db.DummyLdbcSnbInteractiveOperationResultSets; import org.ldbcouncil.snb.driver.workloads.interactive.queries.LdbcNoResult; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.api.Disabled; + +import java.io.IOException; +import java.io.File; import java.util.List; import java.util.Map; +import java.util.stream.Stream; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertTrue; public class InteractiveWorkloadTest extends WorkloadTest { - @Override - public Workload workload() throws Exception + private Workload workload() throws Exception { DriverConfiguration configuration = ConsoleAndFileDriverConfiguration .fromDefaults( @@ -53,8 +64,7 @@ public Workload workload() throws Exception return workload; } - @Override - public List> operationsAndResults() throws Exception + private List> operationsAndResults() throws Exception { return Lists.newArrayList( Tuple.tuple2( @@ -224,144 +234,247 @@ public List> operationsAndResults() throws Exception ); } - @Override - public List configurations() throws Exception + public static DriverConfiguration configurationWithLongReadsOnly() throws DriverConfigurationException, IOException { - return Lists.newArrayList( - // LONG READS ONLY, NO SHORT READS AND NO WRITES - ConsoleAndFileDriverConfiguration.fromDefaults( - DummyLdbcSnbInteractiveDb.class.getName(), - LdbcSnbInteractiveWorkload.class.getName(), - 1_000_000 - ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 0 ) - ).applyArgs( - LdbcSnbInteractiveWorkloadConfiguration.withoutWrites( - LdbcSnbInteractiveWorkloadConfiguration.withoutShortReads( - LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() - ) - ) - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.SCALE_FACTOR, Long.toString(1) - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "false" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.0000001" - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) - ), - // SHORT AND LONG READS, NO WRITES - ConsoleAndFileDriverConfiguration.fromDefaults( - DummyLdbcSnbInteractiveDb.class.getName(), - LdbcSnbInteractiveWorkload.class.getName(), - 1_000_000 - ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 100_000 ) - ).applyArgs( - LdbcSnbInteractiveWorkloadConfiguration.withoutWrites( + // LONG READS ONLY, NO SHORT READS AND NO WRITES + return ConsoleAndFileDriverConfiguration + .fromDefaults( + DummyLdbcSnbInteractiveDb.class.getName(), + LdbcSnbInteractiveWorkload.class.getName(), + 1_000_000 + ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 0 ) + ).applyArgs( + LdbcSnbInteractiveWorkloadConfiguration.withoutWrites( + LdbcSnbInteractiveWorkloadConfiguration.withoutShortReads( LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() ) - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "false" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.000001" - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) - ), - // WRITES ONLY - ConsoleAndFileDriverConfiguration.fromDefaults( - DummyLdbcSnbInteractiveDb.class.getName(), - LdbcSnbInteractiveWorkload.class.getName(), - 50_000 - ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 1_000 ) - ).applyArgs( - LdbcSnbInteractiveWorkloadConfiguration.withoutLongReads( - LdbcSnbInteractiveWorkloadConfiguration.withoutShortReads( - LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() - ) - ) - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "false" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.00001" - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) - ), - // FULL WORKLOAD - ConsoleAndFileDriverConfiguration.fromDefaults( - DummyLdbcSnbInteractiveDb.class.getName(), - LdbcSnbInteractiveWorkload.class.getName(), - 1_000_000 - ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 0 ) - ).applyArgs( - LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "false" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.0000001" - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) - ), - // FULL WORKLOAD - ConsoleAndFileDriverConfiguration.fromDefaults( - DummyLdbcSnbInteractiveDb.class.getName(), - LdbcSnbInteractiveWorkload.class.getName(), - 1_000_000 - ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 100_000 ) - ).applyArgs( - LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() - ).applyArg( - ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, - "true" - ).applyArg( - ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, - "0.001" - ).applyArg( - LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, - TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) ) + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.SCALE_FACTOR, Long.toString(1) + ).applyArg( + ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, + "false" + ).applyArg( + ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, + "0.0000001" + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArgs( + MapUtils.loadPropertiesToMap( + TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) + ); + } + + public static DriverConfiguration configurationWithLongAndShortReads() throws DriverConfigurationException, IOException + { + // SHORT AND LONG READS, NO WRITES + return ConsoleAndFileDriverConfiguration + .fromDefaults( + DummyLdbcSnbInteractiveDb.class.getName(), + LdbcSnbInteractiveWorkload.class.getName(), + 1_000_000 + ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 100_000 ) + ).applyArgs( + LdbcSnbInteractiveWorkloadConfiguration.withoutWrites( + LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() + ) + ).applyArg( + ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, + "false" + ).applyArg( + ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, + "0.000001" + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArgs( + MapUtils.loadPropertiesToMap( + TestUtils.getResource( "/snb/interactive/updateStream.properties" ) + ) + ); + } + + public static DriverConfiguration configurationWithWritesOnly() throws DriverConfigurationException, IOException + { + // WRITES ONLY + return ConsoleAndFileDriverConfiguration + .fromDefaults( + DummyLdbcSnbInteractiveDb.class.getName(), + LdbcSnbInteractiveWorkload.class.getName(), + 50_000 + ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 1_000 ) + ).applyArgs( + LdbcSnbInteractiveWorkloadConfiguration.withoutLongReads( + LdbcSnbInteractiveWorkloadConfiguration.withoutShortReads( + LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() + ) + ) + ).applyArg( + ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, + "false" + ).applyArg( + ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, + "0.00001" + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArgs( + MapUtils.loadPropertiesToMap( + TestUtils.getResource( "/snb/interactive/updateStream.properties" ) + ) + ); + } + + public static DriverConfiguration configurationWithFullWorkloadWithoutWarmup() throws DriverConfigurationException, IOException + { + return ConsoleAndFileDriverConfiguration.fromDefaults( + DummyLdbcSnbInteractiveDb.class.getName(), + LdbcSnbInteractiveWorkload.class.getName(), + 1_000_000 + ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 0 ) + ).applyArgs( + LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() + ).applyArg( + ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, + "false" + ).applyArg( + ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, + "0.0000001" + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArgs( + MapUtils.loadPropertiesToMap( + TestUtils.getResource( "/snb/interactive/updateStream.properties" ) + ) + ); + } + + public static DriverConfiguration configurationWithFullWorkloadWithWarmup() throws DriverConfigurationException, IOException + { + // FULL WORKLOAD + return ConsoleAndFileDriverConfiguration.fromDefaults( + DummyLdbcSnbInteractiveDb.class.getName(), + LdbcSnbInteractiveWorkload.class.getName(), + 1_000_000 + ).applyArg( ConsoleAndFileDriverConfiguration.WARMUP_COUNT_ARG, Long.toString( 100_000 ) + ).applyArgs( + LdbcSnbInteractiveWorkloadConfiguration.defaultConfigSF1() + ).applyArg( + ConsoleAndFileDriverConfiguration.IGNORE_SCHEDULED_START_TIMES_ARG, + "true" + ).applyArg( + ConsoleAndFileDriverConfiguration.TIME_COMPRESSION_RATIO_ARG, + "0.001" + ).applyArg( + LdbcSnbInteractiveWorkloadConfiguration.PARAMETERS_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, + TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() + ).applyArgs( + MapUtils.loadPropertiesToMap( + TestUtils.getResource( "/snb/interactive/updateStream.properties" ) + ) + ); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldGenerateManyOperationsInReasonableTimeForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + boolean workloadGeneratedOperationsBeforeTimeout = shouldGenerateManyOperationsInReasonableTime(configuration, temporaryFolder); + assertTrue( workloadGeneratedOperationsBeforeTimeout ); + } + + @Test + public void shouldBeAbleToSerializeAndMarshalAllOperationResultsForInteractiveWorkload() throws Exception + { + List> operationsAndResults = operationsAndResults(); + shouldBeAbleToSerializeAndMarshalAllOperationResults(operationsAndResults); + } + + @Test + public void shouldBeAbleToSerializeAndMarshalAllOperationsForInteractiveWorkload() throws Exception + { + Workload workload = workload(); + List> operationsAndResults = operationsAndResults(); + shouldBeAbleToSerializeAndMarshalAllOperations(workload, operationsAndResults); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldBeRepeatableWhenTwoIdenticalWorkloadsAreUsedWithIdenticalGeneratorFactoriesForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldBeRepeatableWhenTwoIdenticalWorkloadsAreUsedWithIdenticalGeneratorFactories(configuration, temporaryFolder); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldLoadFromConfigFileForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldLoadFromConfigFile(configuration, temporaryFolder); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldAssignMonotonicallyIncreasingScheduledStartTimesToOperationsForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldAssignMonotonicallyIncreasingScheduledStartTimesToOperations(configuration, temporaryFolder); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldRunWorkloadWithForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldRunWorkload(configuration, temporaryFolder); + } + + @ParameterizedTest + @MethodSource("configurations") + public void shouldCreateValidationParametersThenUseThemToPerformDatabaseValidationThenPassForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldCreateValidationParametersThenUseThemToPerformDatabaseValidationThenPass(configuration, temporaryFolder); + } + + @Disabled + @ParameterizedTest + @MethodSource("configurations") + public void shouldPassWorkloadValidationForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + { + shouldPassWorkloadValidation(configuration, temporaryFolder); + } + + private static Stream configurations() throws Exception{ + return Stream.of( + Arguments.of(configurationWithLongReadsOnly()), + Arguments.of(configurationWithLongAndShortReads()), + Arguments.of(configurationWithWritesOnly()), + Arguments.of(configurationWithFullWorkloadWithoutWarmup()), + Arguments.of(configurationWithFullWorkloadWithWarmup()) ); } + @Test + public void shouldHaveNonNegativeTypesForAllOperationsForInteractiveWorkload() throws Exception + { + shouldHaveNonNegativeTypesForAllOperations(workload(), operationsAndResults()); + } + + @Test + public void shouldHaveOneToOneMappingBetweenOperationClassesAndOperationTypesForInteractiveWorkload() throws Exception + { + shouldHaveOneToOneMappingBetweenOperationClassesAndOperationTypes(workload()); + } + @Test public void shouldConvertFrequenciesToInterleavesWhenAllFrequenciesProvidedAndAllUpdatesEnabled() throws Exception { From 6e8654356602e2702ec2a1c893ebb1ce79bea7ec Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:16:34 +0200 Subject: [PATCH 03/13] Add parallel execution --- src/test/resources/junit-platform.properties | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/test/resources/junit-platform.properties diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties new file mode 100644 index 000000000..783ee9bd3 --- /dev/null +++ b/src/test/resources/junit-platform.properties @@ -0,0 +1,4 @@ +junit.jupiter.execution.parallel.enabled = true +junit.jupiter.execution.parallel.mode.default = concurrent +junit.jupiter.execution.parallel.mode.classes.default = concurrent +junit.jupiter.execution.parallel.config.dynamic.factor = 0.25 \ No newline at end of file From ef935c110a731c63f85428281ec9c4bb6cc0027c Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:19:22 +0200 Subject: [PATCH 04/13] Update pom.xml --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 8b57e89e2..36949f3ab 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,12 @@ ${junit.version} test + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + org.apache.logging.log4j log4j-api From e60971021f63bbbda0f9fee0558a50c1b78caf9c Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:33:22 +0200 Subject: [PATCH 05/13] Add parallelism CircleCI. --- .circleci/config.yml | 25 +++++++++++++++++--- src/test/resources/junit-platform.properties | 4 ---- 2 files changed, 22 insertions(+), 7 deletions(-) delete mode 100644 src/test/resources/junit-platform.properties diff --git a/.circleci/config.yml b/.circleci/config.yml index f350914ca..7dc4eac4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,20 +3,39 @@ orbs: slack: circleci/slack@3.4.2 workflows: version: 2 - build: + build-then-test: jobs: - compile_driver + - test_driver: + requires: + - compile_driver - test_conversion_script jobs: compile_driver: + docker: + - image: cimg/openjdk:11.0.16 + steps: + - checkout + - run: ./mvnw -Dmaven.test.skip=true package + + test_driver: + parallelism: 4 # parallel containers to split the tests among docker: - image: cimg/openjdk:11.0.16 steps: - checkout - run: | - mvn test | tee mvn.log - grep 'BUILD SUCCESS' mvn.log + ./mvnw \ + -Dtest=$(for file in $(circleci tests glob "src/test/**/**.java" \ + | circleci tests split --split-by=timings); \ + do basename $file \ + | sed -e "s/.java/,/"; \ + done | tr -d '\r\n') \ + -e test + - store_test_results: # We use this timing data to optimize the future runs + path: target/surefire-reports + test_conversion_script: machine: image: ubuntu-2204:2022.04.1 diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties deleted file mode 100644 index 783ee9bd3..000000000 --- a/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,4 +0,0 @@ -junit.jupiter.execution.parallel.enabled = true -junit.jupiter.execution.parallel.mode.default = concurrent -junit.jupiter.execution.parallel.mode.classes.default = concurrent -junit.jupiter.execution.parallel.config.dynamic.factor = 0.25 \ No newline at end of file From f85a7bb6c644d9fc31dcda4f8252c91a7fa60c1a Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:34:17 +0200 Subject: [PATCH 06/13] Update run command for build --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7dc4eac4d..ad0e2efb2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ jobs: - image: cimg/openjdk:11.0.16 steps: - checkout - - run: ./mvnw -Dmaven.test.skip=true package + - run: mvn clean install -DskipTests test_driver: parallelism: 4 # parallel containers to split the tests among From 409ceb37af27f1a6cdef44c2fa02370af0cdf28a Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sat, 24 Sep 2022 23:37:02 +0200 Subject: [PATCH 07/13] Update test run command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad0e2efb2..77af56f92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,7 @@ jobs: steps: - checkout - run: | - ./mvnw \ + mvn \ -Dtest=$(for file in $(circleci tests glob "src/test/**/**.java" \ | circleci tests split --split-by=timings); \ do basename $file \ From d94247a810ee1201d8324a947482430af3d80d42 Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 09:54:33 +0200 Subject: [PATCH 08/13] Reduce parallelism in CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 77af56f92..509da26be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,7 +20,7 @@ jobs: - run: mvn clean install -DskipTests test_driver: - parallelism: 4 # parallel containers to split the tests among + parallelism: 2 # parallel containers to split the tests among docker: - image: cimg/openjdk:11.0.16 steps: From 1fe875f884309b26eada48839f9910872054226d Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 09:54:48 +0200 Subject: [PATCH 09/13] Remove old properties file --- .../interactive/InteractiveWorkloadTest.java | 33 ++++--------------- .../snb/interactive/updateStream.properties | 5 --- 2 files changed, 6 insertions(+), 32 deletions(-) delete mode 100644 src/test/resources/snb/interactive/updateStream.properties diff --git a/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java b/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java index c612df63c..967770eba 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/workloads/interactive/InteractiveWorkloadTest.java @@ -7,7 +7,6 @@ import org.ldbcouncil.snb.driver.control.DriverConfiguration; import org.ldbcouncil.snb.driver.control.DriverConfigurationException; import org.ldbcouncil.snb.driver.testutils.TestUtils; -import org.ldbcouncil.snb.driver.util.MapUtils; import org.ldbcouncil.snb.driver.util.Tuple; import org.ldbcouncil.snb.driver.util.Tuple2; import org.ldbcouncil.snb.driver.workloads.ClassNameWorkloadFactory; @@ -262,9 +261,6 @@ public static DriverConfiguration configurationWithLongReadsOnly() throws Driver TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) ); } @@ -292,10 +288,6 @@ public static DriverConfiguration configurationWithLongAndShortReads() throws Dr TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) ); } @@ -325,10 +317,6 @@ public static DriverConfiguration configurationWithWritesOnly() throws DriverCon TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) ); } @@ -352,10 +340,6 @@ public static DriverConfiguration configurationWithFullWorkloadWithoutWarmup() t TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) ); } @@ -380,10 +364,6 @@ public static DriverConfiguration configurationWithFullWorkloadWithWarmup() thro TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ).applyArg( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() - ).applyArgs( - MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ) ); } @@ -445,13 +425,12 @@ public void shouldCreateValidationParametersThenUseThemToPerformDatabaseValidati shouldCreateValidationParametersThenUseThemToPerformDatabaseValidationThenPass(configuration, temporaryFolder); } - @Disabled - @ParameterizedTest - @MethodSource("configurations") - public void shouldPassWorkloadValidationForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception - { - shouldPassWorkloadValidation(configuration, temporaryFolder); - } + // @ParameterizedTest + // @MethodSource("configurations") + // public void shouldPassWorkloadValidationForInteractiveWorkload(DriverConfiguration configuration, @TempDir File temporaryFolder) throws Exception + // { + // shouldPassWorkloadValidation(configuration, temporaryFolder); + // } private static Stream configurations() throws Exception{ return Stream.of( diff --git a/src/test/resources/snb/interactive/updateStream.properties b/src/test/resources/snb/interactive/updateStream.properties deleted file mode 100644 index c65a22f59..000000000 --- a/src/test/resources/snb/interactive/updateStream.properties +++ /dev/null @@ -1,5 +0,0 @@ -ldbc.snb.interactive.gct_delta_duration:10000 -ldbc.snb.interactive.min_write_event_start_time:1293862545711 -ldbc.snb.interactive.max_write_event_start_time:1296471582082 -ldbc.snb.interactive.update_interleave:49274 -ldbc.snb.interactive.num_events:52949 From 3b23b574c0dc0e9afe218f09893da9287dc8f78f Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 09:59:57 +0200 Subject: [PATCH 10/13] Remove references updateStream.properties --- .../snb/driver/runtime/WorkloadRunnerTest.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java b/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java index 47ab9fe62..fde94df8e 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java @@ -351,10 +351,6 @@ private void doShouldRunReadOnlyLdbcWorkloadWithNothingDbAndReturnExpectedMetric flushLog ); - configuration = (ConsoleAndFileDriverConfiguration) configuration - .applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource( - "/snb/interactive/updateStream.properties" ) ) ); - controlService = new LocalControlService( timeSource.nowAsMilli(), configuration, @@ -576,10 +572,6 @@ public void doShouldRunReadWriteLdbcWorkloadWithNothingDbAndReturnExpectedMetric flushLog ); - configuration = (ConsoleAndFileDriverConfiguration) configuration - .applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource( - "/snb/interactive/updateStream.properties" ) ) ); - controlService = new LocalControlService( timeSource.nowAsMilli(), configuration, @@ -847,10 +839,6 @@ private void doShouldRunReadOnlyLdbcWorkloadWithNothingDbWhileIgnoringScheduledS flushLog ); - configuration = (ConsoleAndFileDriverConfiguration) configuration - .applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource( - "/snb/interactive/updateStream.properties" ) ) ); - controlService = new LocalControlService( timeSource.nowAsMilli() + 1000, configuration, From 278ccf0317ea618d591aa88e0c7a57f83dc1cfa3 Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 10:04:54 +0200 Subject: [PATCH 11/13] Remove properties file from config --- .../org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java b/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java index fde94df8e..e072cf3f8 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/runtime/WorkloadRunnerTest.java @@ -144,10 +144,6 @@ public void shouldRunReadOnlyLdbcWorkloadWithNothingDbAndCrashInSaneManner() flushLog ); - configuration = (ConsoleAndFileDriverConfiguration) configuration - .applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource( - "/snb/interactive/updateStream.properties" ) ) ); - controlService = new LocalControlService( timeSource.nowAsMilli(), configuration, From 87d7cedb360e6ed8841c2b7044ea1838a81543a5 Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 10:13:45 +0200 Subject: [PATCH 12/13] Remove updateStream from config in tests --- .../driver/generator/TimeMappingOperationGeneratorTest.java | 5 ----- .../ldbcouncil/snb/driver/validation/DbValidatorTest.java | 6 ------ .../ValidationParamsToCsvRowsToValidationParamsTest.java | 3 --- 3 files changed, 14 deletions(-) diff --git a/src/test/java/org/ldbcouncil/snb/driver/generator/TimeMappingOperationGeneratorTest.java b/src/test/java/org/ldbcouncil/snb/driver/generator/TimeMappingOperationGeneratorTest.java index 64ef69bee..dee3fca21 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/generator/TimeMappingOperationGeneratorTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/generator/TimeMappingOperationGeneratorTest.java @@ -393,11 +393,6 @@ public void shouldNotBreakTheMonotonicallyIncreasingScheduledStartTimesOfOperati flushLog ); - Map updateStreamParams = MapUtils.loadPropertiesToMap( - TestUtils.getResource( "/snb/interactive/updateStream.properties" ) - ); - configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( updateStreamParams ); - Workload workload = new LdbcSnbInteractiveWorkload(); workload.init( configuration ); diff --git a/src/test/java/org/ldbcouncil/snb/driver/validation/DbValidatorTest.java b/src/test/java/org/ldbcouncil/snb/driver/validation/DbValidatorTest.java index 1e9aa066b..c96573441 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/validation/DbValidatorTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/validation/DbValidatorTest.java @@ -54,9 +54,6 @@ public void shouldFailValidationWhenDbImplementationIsIncorrect() paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ); configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap ); - configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( - MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) - ); Workload workload = new LdbcSnbInteractiveWorkload(); workload.init( configuration ); @@ -113,9 +110,6 @@ public void shouldPassValidationWhenDbImplementationIsCorrect() paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ); configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap ); - configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( - MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) - ); Workload workload = new LdbcSnbInteractiveWorkload(); workload.init( configuration ); diff --git a/src/test/java/org/ldbcouncil/snb/driver/validation/ValidationParamsToCsvRowsToValidationParamsTest.java b/src/test/java/org/ldbcouncil/snb/driver/validation/ValidationParamsToCsvRowsToValidationParamsTest.java index f606283ec..a38551b56 100644 --- a/src/test/java/org/ldbcouncil/snb/driver/validation/ValidationParamsToCsvRowsToValidationParamsTest.java +++ b/src/test/java/org/ldbcouncil/snb/driver/validation/ValidationParamsToCsvRowsToValidationParamsTest.java @@ -45,9 +45,6 @@ public void validationParametersShouldBeUnchangedAfterSerializingAndMarshalling( paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY, TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() ); configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap ); - configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( - MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) ) - ); Workload workload = new LdbcSnbInteractiveWorkload(); workload.init( configuration ); From 6225594ae6d97c6928a699cd8772a074cd17f405 Mon Sep 17 00:00:00 2001 From: David Puroja Date: Sun, 25 Sep 2022 10:14:05 +0200 Subject: [PATCH 13/13] Add junit properties --- src/test/resources/junit-platform.properties | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/test/resources/junit-platform.properties diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties new file mode 100644 index 000000000..c65746afa --- /dev/null +++ b/src/test/resources/junit-platform.properties @@ -0,0 +1,4 @@ +junit.jupiter.execution.parallel.enabled = true +junit.jupiter.execution.parallel.mode.default = concurrent +junit.jupiter.execution.parallel.mode.classes.default = concurrent +junit.jupiter.execution.parallel.config.dynamic.factor = 0.25 \ No newline at end of file