Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3626 from input-output-hk/devops-1016-acceptance-…
Browse files Browse the repository at this point in the history
…tests-memory-limit

[DEVOPS-1052] tests: Limit memory usage of nightly blockchain sync
  • Loading branch information
rvl committed Sep 26, 2018
2 parents 632e47d + f9f2471 commit 8251c93
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions scripts/test/acceptance/default.nix
Expand Up @@ -14,10 +14,18 @@ let
iohkPkgs = import ./../../.. { inherit config system pkgs gitrev; };

cardanoDeps = with iohkPkgs; [ cardano-sl-tools cardano-sl-wallet-new ];
demoClusterDeps = with pkgs; [ jq coreutils curl gnused openssl ];
demoClusterDeps = with pkgs; [ jq coreutils curl gnused openssl time ];
allDeps = demoClusterDeps ++ cardanoDeps;

wallet = pkgs.callPackage ../../launch/connect-to-cluster { inherit gitrev stateDir environment; };
wallet = pkgs.callPackage ../../launch/connect-to-cluster {
inherit gitrev stateDir environment;

# This will limit heap size to 1GB, along with the usual RTS options.
ghcRuntimeArgs = "-N2 -qg -A1m -I0 -T -M1G";

# Temporarily run the old wallet code until CBR-420 is resolved.
additionalNodeArgs = "--legacy-wallet";
};

in
pkgs.writeScript "acceptance-tests-${environment}" ''
Expand Down Expand Up @@ -46,7 +54,7 @@ in
${utf8LocaleSetting}
echo Launching wallet node: ${wallet}
${wallet} &> ${stateDir}/logs/wallet.log &
${pkgs.time}/bin/time -v ${wallet} &> ${stateDir}/logs/wallet.log &
wallet_pid=$!
start_time=$(date +%s)
Expand Down Expand Up @@ -75,7 +83,15 @@ in
fi
if ! kill -0 $wallet_pid; then
echo "Wallet is no longer running -- exiting"
echo
echo "***"
echo "*** Here are the last 200 lines of ${stateDir}/logs/wallet.log"
echo "***"
tail -n200 ${stateDir}/logs/wallet.log
echo
echo "***"
echo "*** Wallet is no longer running -- exiting"
echo "***"
exit 1
fi
done
Expand Down

0 comments on commit 8251c93

Please sign in to comment.