Skip to content

Commit

Permalink
Add setting for enabling indexes in stress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Nov 15, 2016
1 parent 31fa428 commit c794bef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.neo4j.io.fs.FileUtils;
import org.neo4j.kernel.impl.store.format.standard.StandardV3_0;

import static java.lang.Boolean.parseBoolean;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.getProperty;
Expand All @@ -58,6 +59,7 @@ public class BackupStoreCopyInteractionStressTesting
private static final String DEFAULT_NUMBER_OF_CORES = "3";
private static final String DEFAULT_NUMBER_OF_EDGES = "1";
private static final String DEFAULT_DURATION_IN_MINUTES = "30";
private static final String DEFAULT_ENABLE_INDEXES = "false";
private static final String DEFAULT_WORKING_DIR = new File( getProperty( "java.io.tmpdir" ) ).getPath();
private static final String DEFAULT_BASE_CORE_BACKUP_PORT = "8000";
private static final String DEFAULT_BASE_EDGE_BACKUP_PORT = "9000";
Expand All @@ -77,6 +79,8 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception
DEFAULT_BASE_CORE_BACKUP_PORT ) );
int baseEdgeBackupPort = parseInt( fromEnv( "BACKUP_STORE_COPY_INTERACTION_STRESS_BASE_EDGE_BACKUP_PORT",
DEFAULT_BASE_EDGE_BACKUP_PORT ) );
boolean enableIndexes = parseBoolean(
fromEnv( "BACKUP_STORE_COPY_INTERACTION_STRESS_ENABLE_INDEXES", DEFAULT_ENABLE_INDEXES ) );

File clusterDirectory = ensureExistsAndEmpty( new File( workingDirectory, "cluster" ) );
File backupDirectory = ensureExistsAndEmpty( new File( workingDirectory, "backups" ) );
Expand Down Expand Up @@ -107,7 +111,10 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception
try
{
cluster.start();
Workload.setupIndexes( cluster );
if ( enableIndexes )
{
Workload.setupIndexes( cluster );
}

Future<Throwable> workload = service.submit( new Workload( keepGoing, onFailure, cluster ) );
Future<Throwable> startStopWorker =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.neo4j.io.fs.FileUtils;
import org.neo4j.kernel.impl.store.format.standard.StandardV3_0;

import static java.lang.Boolean.parseBoolean;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.getProperty;
Expand All @@ -54,6 +55,7 @@ public class CatchupStoreCopyInteractionStressTesting
private static final String DEFAULT_NUMBER_OF_CORES = "3";
private static final String DEFAULT_NUMBER_OF_EDGES = "1";
private static final String DEFAULT_DURATION_IN_MINUTES = "30";
private static final String DEFAULT_ENABLE_INDEXES = "false";
private static final String DEFAULT_WORKING_DIR = new File( getProperty( "java.io.tmpdir" ) ).getPath();

@Test
Expand All @@ -67,6 +69,8 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception
parseLong( fromEnv( "CATCHUP_STORE_COPY_INTERACTION_STRESS_DURATION", DEFAULT_DURATION_IN_MINUTES ) );
String workingDirectory =
fromEnv( "CATCHUP_STORE_COPY_INTERACTION_STRESS_WORKING_DIRECTORY", DEFAULT_WORKING_DIR );
boolean enableIndexes = parseBoolean(
fromEnv( "CATCHUP_STORE_COPY_INTERACTION_STRESS_ENABLE_INDEXES", DEFAULT_ENABLE_INDEXES ) );

File clusterDirectory = ensureExistsAndEmpty( new File( workingDirectory, "cluster" ) );

Expand All @@ -88,7 +92,10 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception
try
{
cluster.start();
Workload.setupIndexes( cluster );
if ( enableIndexes )
{
Workload.setupIndexes( cluster );
}

Future<Throwable> workload = service.submit( new Workload( keepGoing, onFailure, cluster ) );
Future<Throwable> startStopWorker =
Expand Down

0 comments on commit c794bef

Please sign in to comment.