Skip to content

Commit

Permalink
Snap 1201 (#441)
Browse files Browse the repository at this point in the history
Adding long running hydra tests for testing product behavior when the cluster is up and running for long duration and operations are being performed continuously.
  • Loading branch information
sonalsagarwal committed Dec 3, 2016
1 parent 1d144f9 commit da77cc7
Show file tree
Hide file tree
Showing 7 changed files with 312 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hydra.HostPrms-hostNames =
fcn "hydra.TestConfigFcns.pool(\"<host1> <host2> <host3> <host4>\", ${snappyStoreHosts})" ncf
fcn "hydra.TestConfigFcns.pool(\"<host1> <host2>\", ${leadHosts})" ncf
fcn "hydra.TestConfigFcns.pool(\"<host3> <host4>\", ${locatorHosts})" ncf
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hydra.HostPrms-hostNames =
fcn "hydra.TestConfigFcns.pool(\"<host1> <host2> <host3> <host4>\", ${snappyStoreHosts})" ncf
fcn "hydra.TestConfigFcns.pool(\"<host1> <host2>\", ${leadHosts})" ncf
fcn "hydra.TestConfigFcns.pool(\"<host3> <host4>\", ${locatorHosts})" ncf
fcn "hydra.TestConfigFcns.pool(\"<host1> <host2> <host3>\", ${workerHosts})" ncf
;
47 changes: 47 additions & 0 deletions dtests/src/test/java/io/snappydata/hydra/longRun/longRunTest.bt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//can run any one test for ~40 hrs without stopping the cluster, individual lead and server node will go down in HA version of test.
//We can also run the tests one after other, but the cluster will stop after each test.
//currently we are running with northwind schema.

/*
// Embeded mode
io/snappydata/hydra/longRun/longRunTestEmbededMode.conf
A=snappyStore snappyStoreHosts=4 snappyStoreVMsPerHost=2 snappyStoreThreadsPerVM=4
B=lead leadHosts=2 leadVMsPerHost=1 leadThreadsPerVM=2
C=locator locatorHosts=3 locatorVMsPerHost=1 locatorThreadsPerVM=1
redundantCopies=1
dataFilesLocation="$GEMFIRE/../../../tests/common/src/main/resources/northwind/"
tableType="Colocated"
fullResultSetValidation = true

// Embeded mode HA
io/snappydata/hydra/longRun/longRunTestEmbededModeWithHA.conf
A=snappyStore snappyStoreHosts=4 snappyStoreVMsPerHost=2 snappyStoreThreadsPerVM=4
B=lead leadHosts=2 leadVMsPerHost=1 leadThreadsPerVM=2
C=locator locatorHosts=3 locatorVMsPerHost=1 locatorThreadsPerVM=1
redundantCopies=1
dataFilesLocation="$GEMFIRE/../../../tests/common/src/main/resources/northwind/"
tableType="Colocated"
fullResultSetValidation = true

// Split mode
io/snappydata/hydra/longRun/longRunTestSplitMode.conf
A=snappyStore snappyStoreHosts=4 snappyStoreVMsPerHost=2 snappyStoreThreadsPerVM=4
B=lead leadHosts=2 leadVMsPerHost=1 leadThreadsPerVM=2
C=locator locatorHosts=3 locatorVMsPerHost=1 locatorThreadsPerVM=1
D=worker workerHosts=3 workerVMsPerHost=1 workerThreadsPerVM=1
redundantCopies=1
dataFilesLocation="$GEMFIRE/../../../tests/common/src/main/resources/northwind/"
tableType="Colocated"
fullResultSetValidation = true
*/

// Split mode HA
io/snappydata/hydra/longRun/longRunTestSplitModeWithHA.conf
A=snappyStore snappyStoreHosts=4 snappyStoreVMsPerHost=2 snappyStoreThreadsPerVM=4
B=lead leadHosts=2 leadVMsPerHost=1 leadThreadsPerVM=2
C=locator locatorHosts=2 locatorVMsPerHost=1 locatorThreadsPerVM=1
D=worker workerHosts=3 workerVMsPerHost=1 workerThreadsPerVM=1
redundantCopies=1
dataFilesLocation="$GEMFIRE/../../../tests/common/src/main/resources/northwind/"
tableType="Colocated"
fullResultSetValidation = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
hydra.Prms-testRequirement = "Test to verify product behavior when the cluster is up and running for longer duration with operations being performed continuously in embeded mode ";
hydra.Prms-testDescription = "This test starts the snappy cluster, initializes snappyContext, create tables using sql scripts.
After initialization, test executes tasks with snappy job and sql scripts which validate queries for row and column tables.
These tasks will run for ~40 hrs, which can be configured. ";

INCLUDE $JTESTS/hydraconfig/hydraparams1.inc;
INCLUDE $JTESTS/hydraconfig/topology_3.inc;

hydra.GemFirePrms-names = gemfire1;
hydra.ClientPrms-gemfireNames = gemfire1;
hydra.GemFirePrms-distributedSystem = ds;

THREADGROUP snappyStoreThreads
totalThreads = fcn "(${${A}Hosts} * ${${A}VMsPerHost} * ${${A}ThreadsPerVM}) " ncf
totalVMs = fcn "(${${A}Hosts} * ${${A}VMsPerHost})" ncf
clientNames = fcn "hydra.TestConfigFcns.generateNames(\"${A}\",
${${A}Hosts}, true)" ncf;

THREADGROUP leadThreads
totalThreads = fcn "(${${B}Hosts} * ${${B}VMsPerHost} * ${${B}ThreadsPerVM}) -1 " ncf
totalVMs = fcn "(${${B}Hosts} * ${${B}VMsPerHost})" ncf
clientNames = fcn "hydra.TestConfigFcns.generateNames(\"${B}\",
${${B}Hosts}, true)" ncf;

THREADGROUP locatorThreads
totalThreads = fcn "(${${C}Hosts} * ${${C}VMsPerHost} * ${${C}ThreadsPerVM}) " ncf
totalVMs = fcn "(${${C}Hosts} * ${${C}VMsPerHost})" ncf
clientNames = fcn "hydra.TestConfigFcns.generateNames(\"${C}\",
${${C}Hosts}, true)" ncf;

THREADGROUP snappyThreads
totalThreads = 1
totalVMs = 1
clientNames = fcn "hydra.TestConfigFcns.generateNames(\"${B}\",
${${B}Hosts}, true)" ncf;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_initializeSnappyTest
runMode = always
threadGroups = snappyThreads, locatorThreads, snappyStoreThreads, leadThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_generateSnappyLocatorConfig
runMode = always
threadGroups = locatorThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_writeLocatorConfigData
runMode = always
threadGroups = snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_generateSnappyServerConfig
runMode = always
threadGroups = snappyStoreThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_writeServerConfigData
runMode = always
threadGroups = snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_generateSnappyLeadConfig
runMode = always
threadGroups = leadThreads, snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_writeLeadConfigData
runMode = always
threadGroups = snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_createAndStartSnappyLocator
runMode = always
threadGroups = locatorThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_createAndStartSnappyServers
runMode = always
threadGroups = snappyStoreThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_createAndStartSnappyLeader
runMode = always
threadGroups = leadThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSQLScripts
io.snappydata.hydra.cluster.SnappyPrms-sqlScriptNames = create_and_load_colocatedTables_persistent.sql
io.snappydata.hydra.cluster.SnappyPrms-dataLocation = ${dataFilesLocation}
threadGroups = snappyThreads
;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSnappyJob
io.snappydata.hydra.cluster.SnappyPrms-jobClassNames = io.snappydata.hydra.northwind.ValidateNWQueriesJob
io.snappydata.hydra.cluster.SnappyPrms-appPropsForJobServer = "dataFilesLocation=${dataFilesLocation},tableType=${tableType},fullResultSetValidation=${fullResultSetValidation}"
io.snappydata.hydra.cluster.SnappyPrms-userAppJar = snappydata-store-scala-tests*tests.jar
threadGroups = snappyThreads
maxThreads = 1;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSQLScripts
io.snappydata.hydra.cluster.SnappyPrms-sqlScriptNames = nw_queries.sql
threadGroups = snappyStoreThreads
maxThreads = 1
;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_stopSnappy
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_stopSnappyLeader
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_stopSnappyServers
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_stopSnappyLocator
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_deleteSnappyConfig
threadGroups = snappyThreads;

ENDTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_cleanUpSnappyProcessesOnFailure
clientNames = locator1;

/* end task must stop snappy members because they are not stopped by Hydra */
hydra.Prms-alwaysDoEndTasks = true;

hydra.Prms-totalTaskTimeSec = 144000;
hydra.Prms-maxResultWaitSec = 3600;
hydra.Prms-maxCloseTaskResultWaitSec = 3600;
//hydra.Prms-serialExecution = false;

hydra.VmPrms-extraVMArgs += fcn "hydra.TestConfigFcns.duplicate
(\"-Xms512m -Xmx1g \", ${${A}Hosts}, true)"
ncf
,
fcn "hydra.TestConfigFcns.duplicate
(\"-Xms512m -Xmx1g \", ${${B}Hosts}, true)"
ncf;

hydra.VmPrms-extraVMArgsSUN += "-XX:PermSize=64M -XX:MaxPermSize=256m";

io.snappydata.hydra.cluster.SnappyPrms-userAppJar = snappydata-store-scala-tests*tests.jar;


Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
hydra.Prms-testRequirement += " with lead and server nodes performing HA";
hydra.Prms-testDescription += "While the tasks are being performed, the server and lead nodes will go down and come up.";

INITTASK taskClass = util.StopStartVMs taskMethod = StopStart_initTask
threadGroups = snappyThreads, locatorThreads, snappyStoreThreads, leadThreads;

INCLUDE $JTESTS/io/snappydata/hydra/longRun/longRunTestEmbededMode.conf;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = backUpLeadConfigData
threadGroups = snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = backUpServerConfigData
threadGroups = snappyThreads;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_cycleLeadVM
maxThreads = 1
startInterval = 3600
threadGroups = snappyStoreThreads;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_cycleStoreVms
startInterval = 3000
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = restoreServerConfigData
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = restoreLeadConfigData
threadGroups = snappyThreads;

io.snappydata.hydra.cluster.SnappyPrms-waitTimeBeforeNextCycleVM = 4200; //wait time before next restart.
io.snappydata.hydra.cluster.SnappyPrms-cycleVms = true;

//util.StopStartPrms-stopModes = ONEOF NICE_EXIT MEAN_KILL MEAN_EXIT NICE_KILL FOENO;
util.StopStartPrms-stopModes = NICE_KILL;
util.StopStartPrms-numVMsToStop = RANGE 1 ${redundantCopies} EGNAR;

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
hydra.Prms-testRequirement = "Test to verify product behavior when the cluster is up and running for longer duration with operations being performed continuously in split mode ";
hydra.Prms-testDescription = "This test starts the snappy cluster and spark cluster, initializes snappyContext, create tables using sql scripts.
After initialization, test executes tasks for snappy job, spark app and sql scripts which validate queries for row and column tables.
These tasks will run for ~40 hrs, which can be configured. ";

INCLUDE $JTESTS/io/snappydata/hydra/northwind/startDualModeCluster.conf;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSQLScripts
io.snappydata.hydra.cluster.SnappyPrms-sqlScriptNames = create_and_load_colocatedTables_persistent.sql
io.snappydata.hydra.cluster.SnappyPrms-dataLocation = ${dataFilesLocation}
threadGroups = snappyThreads
;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSnappyJob
io.snappydata.hydra.cluster.SnappyPrms-jobClassNames = io.snappydata.hydra.northwind.ValidateNWQueriesJob
io.snappydata.hydra.cluster.SnappyPrms-appPropsForJobServer = "dataFilesLocation=${dataFilesLocation},tableType=${tableType},fullResultSetValidation=${fullResultSetValidation}"
io.snappydata.hydra.cluster.SnappyPrms-userAppJar = snappydata-store-scala-tests*tests.jar
threadGroups = snappyStoreThreads
maxThreads = 1;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSparkJob
io.snappydata.hydra.cluster.SnappyPrms-sparkJobClassNames = io.snappydata.hydra.northwind.ValidateNWQueriesApp
io.snappydata.hydra.cluster.SnappyPrms-userAppArgs = "${dataFilesLocation} ${tableType} ${fullResultSetValidation}"
io.snappydata.hydra.cluster.SnappyPrms-userAppJar = snappydata-store-scala-tests*tests.jar
threadGroups = leadThreads
;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_executeSQLScripts
io.snappydata.hydra.cluster.SnappyPrms-sqlScriptNames = nw_queries.sql
threadGroups = snappyStoreThreads
maxThreads = 1
;

INCLUDE $JTESTS/io/snappydata/hydra/northwind/stopDualModeCluster.conf;

hydra.Prms-totalTaskTimeSec = 144000;
hydra.Prms-maxResultWaitSec = 3600;
hydra.Prms-maxCloseTaskResultWaitSec = 3600;

hydra.VmPrms-extraVMArgs += fcn "hydra.TestConfigFcns.duplicate
(\"-Xms512m -Xmx1g \", ${${A}Hosts}, true)"
ncf
,
fcn "hydra.TestConfigFcns.duplicate
(\"-Xms512m -Xmx1g \", ${${B}Hosts}, true)"
ncf;

hydra.VmPrms-extraVMArgsSUN += "-XX:PermSize=64M -XX:MaxPermSize=256m";

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
hydra.Prms-testRequirement += " with lead and server nodes performing HA";
hydra.Prms-testDescription += "While the tasks are being performed, the server and lead nodes will go down and come up.";

INITTASK taskClass = util.StopStartVMs taskMethod = StopStart_initTask
threadGroups = snappyThreads, locatorThreads, snappyStoreThreads, leadThreads;

INCLUDE $JTESTS/io/snappydata/hydra/longRun/longRunTestSplitMode.conf;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = backUpLeadConfigData
threadGroups = snappyThreads;

INITTASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = backUpServerConfigData
threadGroups = snappyThreads;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_cycleLeadVM
maxThreads = 1
startInterval = 3600
threadGroups = snappyStoreThreads;

TASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = HydraTask_cycleStoreVms
startInterval = 3000
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = restoreServerConfigData
threadGroups = snappyThreads;

CLOSETASK taskClass = io.snappydata.hydra.cluster.SnappyTest taskMethod = restoreLeadConfigData
threadGroups = snappyThreads;

io.snappydata.hydra.cluster.SnappyPrms-waitTimeBeforeNextCycleVM = 4200; //how long to wait before nodes will be cycled.
io.snappydata.hydra.cluster.SnappyPrms-cycleVms = true;

util.StopStartPrms-stopModes = NICE_KILL;
util.StopStartPrms-numVMsToStop = RANGE 1 ${redundantCopies} EGNAR;

0 comments on commit da77cc7

Please sign in to comment.