nixos/cassandra: Test maxHeapSize
This commit is contained in:
parent
2368345052
commit
3162f45388
|
@ -4,6 +4,14 @@ let
|
||||||
testPackage = pkgs.cassandra;
|
testPackage = pkgs.cassandra;
|
||||||
clusterName = "NixOS Automated-Test Cluster";
|
clusterName = "NixOS Automated-Test Cluster";
|
||||||
|
|
||||||
|
numMaxHeapSize = "400";
|
||||||
|
getHeapLimitCommand = ''
|
||||||
|
nodetool info | grep "^Heap Memory" | awk \'{print $NF}\'
|
||||||
|
'';
|
||||||
|
checkHeapLimitCommand = ''
|
||||||
|
[ 1 -eq "$(echo "$(${getHeapLimitCommand}) < ${numMaxHeapSize}" | ${pkgs.bc}/bin/bc)" ]
|
||||||
|
'';
|
||||||
|
|
||||||
cassandraCfg = ipAddress:
|
cassandraCfg = ipAddress:
|
||||||
{ enable = true;
|
{ enable = true;
|
||||||
inherit clusterName;
|
inherit clusterName;
|
||||||
|
@ -11,6 +19,8 @@ let
|
||||||
rpcAddress = ipAddress;
|
rpcAddress = ipAddress;
|
||||||
seedAddresses = [ "192.168.1.1" ];
|
seedAddresses = [ "192.168.1.1" ];
|
||||||
package = testPackage;
|
package = testPackage;
|
||||||
|
maxHeapSize = "${numMaxHeapSize}M";
|
||||||
|
heapNewSize = "100M";
|
||||||
};
|
};
|
||||||
nodeCfg = ipAddress: extra: {pkgs, config, ...}:
|
nodeCfg = ipAddress: extra: {pkgs, config, ...}:
|
||||||
{ environment.systemPackages = [ testPackage ];
|
{ environment.systemPackages = [ testPackage ];
|
||||||
|
@ -55,6 +65,11 @@ in
|
||||||
$cass0->waitUntilSucceeds("nc -z localhost 7199");
|
$cass0->waitUntilSucceeds("nc -z localhost 7199");
|
||||||
$cass0->waitUntilSucceeds("nodetool describecluster | grep 'Name: ${clusterName}'");
|
$cass0->waitUntilSucceeds("nodetool describecluster | grep 'Name: ${clusterName}'");
|
||||||
};
|
};
|
||||||
|
subtest "Heap limit set correctly", sub {
|
||||||
|
# Nodetool takes a while until it can display info
|
||||||
|
$cass0->waitUntilSucceeds('nodetool info');
|
||||||
|
$cass0->succeed('${checkHeapLimitCommand}');
|
||||||
|
};
|
||||||
|
|
||||||
# Check cluster interaction
|
# Check cluster interaction
|
||||||
subtest "Bring up cluster", sub {
|
subtest "Bring up cluster", sub {
|
||||||
|
|
Loading…
Reference in a new issue