integration-tests: Cleanup, add parallelism test
This commit is contained in:
parent
73baa0446f
commit
ba16f50722
7 changed files with 144 additions and 108 deletions
27
integration-tests/parallel/default.nix
Normal file
27
integration-tests/parallel/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
let
|
||||
tools = import ../tools.nix {};
|
||||
in tools.makeTest {
|
||||
name = "colmena-parallel";
|
||||
|
||||
bundle = ./.;
|
||||
|
||||
testScript = ''
|
||||
deployer.succeed("cd /tmp/bundle &&" \
|
||||
"${tools.colmenaExec} apply push -v --eval-node-limit 4 --on @target")
|
||||
|
||||
logs = deployer.succeed("cd /tmp/bundle &&" \
|
||||
"run-copy-stderr ${tools.colmenaExec} apply switch -v --eval-node-limit 4 --parallel 4 --on @target")
|
||||
|
||||
for node in [alpha, beta, gamma]:
|
||||
node.succeed("grep SUCCESS /etc/deployment")
|
||||
|
||||
with subtest("Check that activation is correctly parallelized"):
|
||||
timestamps = list(map(lambda l: int(l.strip().split("---")[1]) / 1000000,
|
||||
filter(lambda l: "Activation triggered" in l, logs.split("\n"))))
|
||||
|
||||
delay = max(timestamps) - min(timestamps)
|
||||
deployer.log(f"Time between activations: {delay}ms")
|
||||
|
||||
assert delay < 2000
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue